Compare commits
2 Commits
3.1g3_DEV1
..
3.1h1
| Author | SHA1 | Date | |
|---|---|---|---|
| 76e445410f | |||
| f10538adbd |
@@ -1632,7 +1632,7 @@ function PrepareMoveChar( sCmd, nInd)
|
||||
EMT.Y1POS = MoveY1 or EMT.Y1POS
|
||||
EMT.TPOS = GetCmdAxMove( Cmd, 'T') or EMT.TPOS
|
||||
end
|
||||
elseif Cmd[1] == '2' then
|
||||
elseif Cmd[1] == '2' or Cmd[1] == '24' then
|
||||
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
|
||||
local MoveY1 = GetCmdAxMove( Cmd, 'Y1')
|
||||
local MoveY2 = GetCmdAxMove( Cmd, 'Y2')
|
||||
@@ -1722,8 +1722,6 @@ function PrepareMoveChar( sCmd, nInd)
|
||||
EMT.V2NEXTPOS = tonumber( Cmd[3])
|
||||
elseif Cmd[1] == '23' then
|
||||
EMT.W2DELTA = tonumber( Cmd[2])
|
||||
elseif Cmd[1] == '24' then
|
||||
EMT.TPOS = GetCmdAxMove( Cmd, 'T') or EMT.TPOS
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
+36
-15
@@ -1,4 +1,4 @@
|
||||
-- Processore standard macchine ONE e PF by EgalWare s.r.l. 2023/11/24
|
||||
-- Processore standard macchine ONE e PF by EgalWare s.r.l. 2026/08/03
|
||||
|
||||
-- Funzioni generiche indipendenti dal controllo
|
||||
|
||||
@@ -610,20 +610,22 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulToolDeselect( dPrevA, bLastRise)
|
||||
|
||||
-- se ToolDeselect chiamata da MLPE, bisogna scaricare perchè è ultimo movimento di rise e poi si cambia utensile
|
||||
-- se ToolDeselect chiamata da MLPE, bisogna scaricare ChainSaw perchè è ultimo movimento di rise e poi si cambia utensile
|
||||
-- o movimento pinze in cui non può esserci ChainSaw in mandrino
|
||||
if dPrevA then
|
||||
local dHeadSet = GetHeadSet( EMT.HEAD)
|
||||
local nHeadSet = GetHeadSet( EMT.HEAD)
|
||||
-- se utensile corrente è sega a catena, devo depositarla
|
||||
if dHeadSet == 1 and HeadIsChainSaw( EMT.HEAD) then
|
||||
if nHeadSet == 1 and HeadIsChainSaw( EMT.HEAD) then
|
||||
-- visualizzo utensile su TcPos
|
||||
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
|
||||
-- nascondo l'utensile sulla testa
|
||||
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
|
||||
-- si cerca prossimo utensile
|
||||
-- si cerca prossimo utensile, se ChainSaw non posso caricarlo, altrimenti preselezione
|
||||
local sTool, sHead, sTcPos, bCarrMove = FindNextToolOnHeadSet( 1, false)
|
||||
-- imposto correttamente i dati di testa
|
||||
local OrigEMC = EMC
|
||||
EMC = { HEAD = sHead or 'H11', TOOL = sTool, TCPOS = sTcPos, TOTDIAM = 0}
|
||||
-- se non precarico utensile allora testa base e T0
|
||||
EMC = { HEAD = sHead or 'H11', TOOL = sTool, TCPOS = sTcPos or 'T0', TOTDIAM = 0}
|
||||
OnSetHead()
|
||||
EMC = OrigEMC
|
||||
-- se c'è prossimo utensile, oppure se non c'è e c'è un movimento carrelli
|
||||
@@ -642,15 +644,17 @@ function OnSimulToolDeselect( dPrevA, bLastRise)
|
||||
LoadNextTool( 1, sTcPos)
|
||||
end
|
||||
end
|
||||
elseif dHeadSet == 2 and HeadIsChainSaw( EMT.HEAD) then
|
||||
elseif nHeadSet == 2 and HeadIsChainSaw( EMT.HEAD) then
|
||||
-- visualizzo utensile su TcPos
|
||||
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
|
||||
-- nascondo l'utensile sulla testa
|
||||
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H2 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
|
||||
-- imposto correttamente i dati di testa
|
||||
-- si cerca prossimo utensile, se ChainSaw non posso caricarlo, altrimenti preselezione
|
||||
local sTool, sHead, sTcPos, bCarrMove = FindNextToolOnHeadSet( 2, false)
|
||||
-- imposto correttamente i dati di testa
|
||||
local OrigEMC = EMC
|
||||
EMC = { HEAD = sHead or 'H21', TOOL = sTool, TCPOS = sTcPos, TOTDIAM = 0}
|
||||
-- se non precarico utensile allora testa base e T0
|
||||
EMC = { HEAD = sHead or 'H21', TOOL = sTool, TCPOS = sTcPos or 'T0', TOTDIAM = 0}
|
||||
OnSetHead()
|
||||
EMC = OrigEMC
|
||||
-- se c'è prossimo utensile, oppure se non c'è e c'è un movimento carrelli
|
||||
@@ -677,28 +681,45 @@ function OnSimulToolDeselect( dPrevA, bLastRise)
|
||||
|
||||
-- se utensile non cambia e non è sega a catena, esco
|
||||
if ( EMT.NEXTTOOL == EMT.PREVTOOL_H1 or EMT.NEXTTOOL == EMT.PREVTOOL_H2) and not HeadIsChainSaw( EMT.NEXTHEAD) then return end
|
||||
-- verifico se la lavorazione successiva è in doppio e cerco l'utensile doppio
|
||||
local nNextMchId = EgtGetNextActiveOperation( EMT.MCHID)
|
||||
local nDouType = 0
|
||||
if nNextMchId and EgtSetCurrMachining( nNextMchId) then
|
||||
nDouType = EgtGetValInNotes( EgtGetMachiningParam( MCH_MP.USERNOTES) or '', 'DOUBLE', 'i')
|
||||
end
|
||||
EgtSetCurrMachining( EMT.MCHID)
|
||||
local sDouTool = ''
|
||||
if nDouType == 2 then
|
||||
if EgtTdbSetCurrTool( EMT.NEXTTOOL) then
|
||||
sDouTool = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES) or '', 'DOUBLE', 's') or ''
|
||||
end
|
||||
EgtTdbSetCurrTool( EMT.TOOL)
|
||||
end
|
||||
-- se utensile corrente diventa il doppio, esco
|
||||
if EMT.PREVTOOL_H2 == sDouTool then return end
|
||||
|
||||
-- deposito utensile
|
||||
EgtOutText( 'Tool change in progress...')
|
||||
|
||||
local dHeadSet = GetHeadSet( EMT.PREVHEAD)
|
||||
local nHeadSet = GetHeadSet( EMT.PREVHEAD)
|
||||
|
||||
-- vado a quota home testa attuale
|
||||
if dHeadSet == 1 then
|
||||
if nHeadSet == 1 then
|
||||
SimulMoveAxes( 'X1', EgtGetAxisHomePos( 'X1'), MCH_SIM_STEP.RAPID, 'Z1', EgtGetAxisHomePos( 'Z1'), MCH_SIM_STEP.RAPID,
|
||||
'B1', EgtGetAxisHomePos( 'B1'), MCH_SIM_STEP.COLLROT, 'C1', EgtGetAxisHomePos( 'C1'), MCH_SIM_STEP.COLLROT)
|
||||
elseif dHeadSet == 2 then
|
||||
elseif nHeadSet == 2 then
|
||||
SimulMoveAxes( 'X2', EgtGetAxisHomePos( 'X2'), MCH_SIM_STEP.RAPID, 'Z2', EgtGetAxisHomePos( 'Z2'), MCH_SIM_STEP.RAPID,
|
||||
'B2', EgtGetAxisHomePos( 'B2'), MCH_SIM_STEP.COLLROT, 'C2', EgtGetAxisHomePos( 'C2'), MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
|
||||
local dNextHeadSet = GetHeadSet( EMT.NEXTHEAD)
|
||||
local nNextHeadSet = GetHeadSet( EMT.NEXTHEAD)
|
||||
|
||||
if dNextHeadSet == 1 then
|
||||
if nNextHeadSet == 1 then
|
||||
-- visualizzo utensile su TcPos
|
||||
ShowToolInTcPos( EMT.PREVTCPOS_H1, true)
|
||||
-- nascondo l'utensile sulla testa
|
||||
EgtSetMode( EgtGetHeadId( EMT.PREVHEAD_H1 or '') or GDB_ID.NULL, GDB_MD.HIDDEN)
|
||||
elseif dNextHeadSet == 2 then
|
||||
elseif nNextHeadSet == 2 then
|
||||
-- visualizzo utensile su TcPos
|
||||
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
|
||||
-- nascondo l'utensile sulla testa
|
||||
|
||||
+27
-34
@@ -527,36 +527,6 @@ local function PrepareClGroup( nParentId)
|
||||
return nClId
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsStartOrRestPhase( nPhase)
|
||||
local sVal = EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'TYPE')
|
||||
return ( sVal == 'START' or sVal == 'REST')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsMidPhase( nPhase)
|
||||
local sVal = EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'TYPE')
|
||||
return ( sVal == 'MID')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsEndPhase( nPhase)
|
||||
local sVal = EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'TYPE')
|
||||
return ( sVal == 'END')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsMid2Phase( nPhase)
|
||||
local sVal = EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'TYPE')
|
||||
return ( sVal == 'MID2')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsEnd2Phase( nPhase)
|
||||
local sVal = EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'TYPE')
|
||||
return ( sVal == 'END2')
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetNextStartOrRestPhase( nPhase)
|
||||
local nNextPhase = nPhase + 1
|
||||
@@ -585,6 +555,23 @@ local function IsFirstMachiningOfStart( nMchId)
|
||||
return true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function IsHeadMachining( nMchId)
|
||||
local vInitAx = EmtGetInitialAxesPos( nMchId)
|
||||
return ( vInitAx and vInitAx[1] > 100 * GEO.EPS_SMALL)
|
||||
end
|
||||
--------------------------------------------------------------------- Idea sostituzione IsHeadMachining controlla anche che Y sia dentro al pezzo
|
||||
--[[local function IsHeadMachining( nMchId)
|
||||
local vInitAx = EmtGetInitialAxesPos( nMchId)
|
||||
local dDeltaZeroBeamY = EgtIf( GetHeadSet( EgtTdbGetCurrToolParam( MCH_TP.HEAD)) == 1, DeltaTabY, Delta2TabY)
|
||||
if vInitAx then
|
||||
if vInitAx[1] > 100 * GEO.EPS_SMALL and vInitAx[2] >= dDeltaZeroBeamY - 100 * GEO.EPS_SMALL and vInitAx[2] <= dDeltaZeroBeamY + EMC.SB + 100 * GEO.EPS_SMALL then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return
|
||||
end]]
|
||||
|
||||
---------------------------------------------------------------------
|
||||
local function GetPhaseRot( nPhase)
|
||||
return ( EgtGetInfo( EgtGetPhaseDisposition( nPhase) or GDB_ID.NULL, 'ROT', 'i') or 0)
|
||||
@@ -1287,14 +1274,20 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
|
||||
elseif not IsEndPhase( EMC.PHASE) then
|
||||
local vCmd = SpecCalcCarriages( dDistFront, dDistBack, dRollFront, dRollBack, dY1DeltaMaxSP, dY2DeltaMinUL, nChar, AuxInfoMach)
|
||||
-- se fase iniziale e ci sono stati movimenti di carrelli
|
||||
if IsStartPhase( EMC.PHASE) and #vCmd > 0 and IsFirstMachiningOfStart( EMC.MCHID) and
|
||||
if ( IsStartPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)) and #vCmd > 0 and IsHeadMachining( EMC.MCHID) and
|
||||
not bPreSplit and not bSplitting and not bPreCut and not bCutting then
|
||||
-- recupero posizione testa trave
|
||||
local dLastTPos, dLastY1Delta = GetLastTPos( vCmd)
|
||||
if not dLastTPos then dLastTPos = EMC.TPOS end
|
||||
if not dLastY1Delta then dLastY1Delta = EMC.Y1DELTA end
|
||||
-- TODO : individuare condizione più corretta nella quale arretrare la testa della trave
|
||||
-- se testa oltre lo zero e entro le corse assi con 5 mm di sicurezza
|
||||
if dLastTPos and dLastTPos < 0 and ParkV1 + dLastY1Delta < MaxY1 - 5 then
|
||||
-- si sposta testa in posizione carico
|
||||
table.insert( vCmd, { 24, 'T', ParkV1, 'Y1', ParkV1 + dLastY1Delta})
|
||||
if dLastTPos and dLastTPos < 0 then
|
||||
-- si sposta testa in posizione di parcheggio rulli (o quanto si può)
|
||||
local dNewTPos = min( ParkV1, MaxY1 - dLastY1Delta - 5)
|
||||
if dNewTPos > 0 then
|
||||
table.insert( vCmd, { 24, 'T', dNewTPos, 'Y1', dNewTPos + dLastY1Delta})
|
||||
end
|
||||
end
|
||||
-- Se non ci sono spostamenti, confermo i parametri di aggancio e di posizione roller
|
||||
elseif SpecTestOnlyRemarkInCmds( vCmd) then
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '3.1g3_DEV1'
|
||||
PP_NVER = '3.1.7.3'
|
||||
PP_VER = '3.1h1'
|
||||
PP_NVER = '3.1.8.1'
|
||||
MIN_MACH_VER = '3.1f4'
|
||||
MACH_NAME = EgtGetCurrMachineName()
|
||||
|
||||
|
||||
+6
-2
@@ -1,7 +1,11 @@
|
||||
==== Common_ONE-PF Update Log ====
|
||||
|
||||
Versione 3.1-- (--/--/2026)
|
||||
- (SIM-GEN) Arretra trave al parcheggio rulli dopo Unload solo se il pinzaggio consente il movimento completo. Altrimenti non fa nulla. Ticket#3102
|
||||
Versione 3.1h1 (05/08/2026)
|
||||
- (SIM-GEN) Se arretra trave al parcheggio rulli dopo Unload non può eseguire movimento completo, esegue movimento parziale solo se questo porta POST > 0. Altrimenti non fa nulla. Ticket#3102
|
||||
- (SIM) OnSimulToolDeselect chiamata da mlpe e ultimo movimento o movimento pinze nel quale non bisogna caricare nessun utensile, forzo TCPOS a 'T0'. Ticket#3114
|
||||
- (SIM) Corretta simulazione utensile già caricato che diventa utensile che lavora in doppio. Ticket#3105
|
||||
- (SIM-GEN) Cmd 24 (arretro trave in parcheggio rulli) anche se è fase END2, tolto controllo se è prima lavorazione e inserito controllo se è lavorazione di testa. Ticket#3089
|
||||
- (GEN) Aggiunta gestione Cmd 24 (arretro trave in parcheggio rulli) come se fosse Cmd 2 (come in simulazione). Ticket#3089
|
||||
|
||||
Versione 3.1g3 (24/07/2026)
|
||||
- (SIM) Non si legge il nome utensile da tabella EMT, ma si utilizza quello corrente salvato in precedenza
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_ONE-PF', -- nome script PP standard
|
||||
VERSION = '3.1--', -- versione script
|
||||
VERSION = '3.1h1', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '3.1f1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user