Compare commits

..

22 Commits

Author SHA1 Message Date
daniele.nicoli 76e445410f Merge branch 'develop' 2026-08-05 15:17:56 +02:00
daniele.nicoli f10538adbd Allineamento con common ver. 3.1h1 2026-08-05 13:05:50 +02:00
daniele.nicoli 9724d936f3 Allineamento a develop dei common per rilascio versione 3.1g3_DEV1. 2026-07-30 11:49:57 +02:00
daniele.nicoli 639ea41eff Merge branch 'master' into develop 2026-07-30 11:14:08 +02:00
andrea.villa 806fd7eb2a Cambio numero versione macchina 2026-07-24 16:26:48 +02:00
andrea.villa 41974c81b5 Allineamento con comon ver. 3.1g3 2026-07-24 16:24:18 +02:00
andrea.villa cbaffa631e Versione minima portato a 3.1f4 2026-07-14 10:43:13 +02:00
andrea.villa 35ba94d30a - Allineamento con common ver. 3.1g2 2026-07-08 16:09:35 +02:00
andrea.villa ef9c8cfb72 Rimosso gestione probe 2026-07-07 12:00:38 +02:00
andrea.villa 749606f943 Merge branch 'develop' 2026-07-07 09:59:48 +02:00
andrea.villa e1be6d1584 Merge branch 'NewLink' into develop 2026-07-07 09:57:41 +02:00
andrea.villa 703e194ab8 Allineamento a common ver. 3.1g1 2026-07-07 09:52:47 +02:00
andrea.villa 27c3aaf1f1 Allineamento con comon ver. 3.1f4 2026-06-17 09:02:52 +02:00
andrea.villa 69d41c02b0 Cambio versione 2026-06-08 14:40:15 +02:00
andrea.villa f5b79d6f6d Allineamento a common ver. 3.1f3 2026-06-08 14:30:34 +02:00
andrea.villa 91414cf313 Allineamento con common ver. 3.1f2 2026-06-05 12:07:54 +02:00
andrea.villa 530b03c5d0 HOTFIX problema simulazione 2026-06-03 11:53:05 +02:00
andrea.villa 296f55042e Merge branch 'develop' 2026-06-03 09:58:29 +02:00
andrea.villa a858f6785d Allineamento con common ver. 3.1f1 2026-06-03 09:58:18 +02:00
daniele.nicoli 01435f40ea Aggiunto Clamp di sicurezza per lettura dei parametri MinJoin da Ts3Data 2026-04-23 12:04:42 +02:00
daniele.nicoli 8c19fd7c7f Merge branch 'master' into develop 2026-04-23 12:04:05 +02:00
andrea.villa d75fd52179 Merge branch 'develop' 2026-03-17 15:20:38 +01:00
8 changed files with 208 additions and 134 deletions
-8
View File
@@ -1,8 +0,0 @@
{
"Lua.diagnostics.globals": [
"EmtRemoveClimb",
"EmtAddClimb",
"EmtRemoveRise",
"EmtAddRise"
]
}
+2 -2
View File
@@ -121,8 +121,8 @@ if EgtExistsFile( sData) then
if Machine.Offsets.MAX_ANGLE_DRILL_CUT then BeamData.MAX_ANGLE_DRILL_CUT = EgtClamp( Machine.Offsets.MAX_ANGLE_DRILL_CUT, 1, 89) end
if Machine.Offsets.ROT90 ~= nil then BeamData.ROT90 = ( Machine.Offsets.ROT90 == 1) end
if Machine.Offsets.CUT_SIC then BeamData.CUT_SIC = EgtClamp( Machine.Offsets.CUT_SIC, 15, 50) end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = Machine.Offsets.MIN_JOIN_S end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = Machine.Offsets.MIN_JOIN_L end
if Machine.Offsets.MIN_JOIN_S then BeamData.MIN_JOIN_S = EgtClamp( Machine.Offsets.MIN_JOIN_S, 80, 150) end
if Machine.Offsets.MIN_JOIN_L then BeamData.MIN_JOIN_L = EgtClamp( Machine.Offsets.MIN_JOIN_L, 300, 450) end
end
if Machine.Trave then
BeamData.MIN_WIDTH = Machine.Trave.XMIN or BeamData.MIN_WIDTH
+9 -7
View File
@@ -1229,6 +1229,14 @@ function OnRapid()
-- calcolo per piano generico
CalcInterpPlane()
EMT.REFLOC = true
-- salvo posizione attuale
local OldL1 = EMT.L1
local OldL2 = EMT.L2
local OldL3 = EMT.L3
-- imposto posizione precedente (non contiene l'offset in X per sovramateriale di testa EMT.X_OFF)
EMT.L1 = EMT.L1o
EMT.L2 = EMT.L2o
EMT.L3 = EMT.L3o
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
@@ -1241,10 +1249,6 @@ function OnRapid()
EMT.PLANEACTIVE = true
-- annullo precedenti per forzare scrittura
EMT.R1p = nil
EMT.R2p = nil
-- emissione movimento
local sAxes = EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
EmtGetAxis('R2')..EmtGetAxis('R1')
@@ -1628,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')
@@ -1718,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
+110 -55
View File
@@ -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
@@ -608,82 +608,118 @@ function OnSimulToolSelect( dPosA)
end
---------------------------------------------------------------------
function OnSimulToolDeselect( dPrevA)
-- se utensile corrente è sega a catena, devo depositarla
if HeadIsChainSaw( EMT.PREVHEAD_H1) 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)
-- se non è chiamata per cambio angolo di presa della sega a catena
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 1, false)
if not dPrevA or not sTool then
function OnSimulToolDeselect( dPrevA, bLastRise)
-- 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 nHeadSet = GetHeadSet( EMT.HEAD)
-- se utensile corrente è sega a catena, devo depositarla
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, 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, 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
local dHomeX1 = EgtGetAxisHomePos( 'X1')
local dHomeC1 = EgtGetAxisHomePos( 'C1')
local dHomeB1 = EgtGetAxisHomePos( 'B1')
-- se c'è prossimo utensile, oppure se non c'è e c'è un movimento carrelli
if sTool or ( not sTool and bCarrMove) or not bLastRise then
-- cambio utensile
EgtSetAxisPos( 'C1', dHomeC1)
EgtSetAxisPos( 'B1', dHomeB1)
EgtSetAxisPos( 'Z1', MaxZ1)
SimulMoveAxis( 'X1', dHomeX1, MCH_SIM_STEP.RAPID)
if sTcPos then
LoadNextTool( 1, DefTcPos1)
local dHomeX1 = EgtGetAxisHomePos( 'X1')
local dHomeC1 = EgtGetAxisHomePos( 'C1')
local dHomeB1 = EgtGetAxisHomePos( 'B1')
-- cambio utensile
EgtSetAxisPos( 'C1', dHomeC1)
EgtSetAxisPos( 'B1', dHomeB1)
EgtSetAxisPos( 'Z1', MaxZ1)
SimulMoveAxis( 'X1', dHomeX1, MCH_SIM_STEP.RAPID)
if sTcPos then
LoadNextTool( 1, sTcPos)
end
end
EMT.CHSAW_OUT = nil
end
elseif HeadIsChainSaw( EMT.PREVHEAD_H2) 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)
-- se non è chiamata per cambio angolo di presa della sega a catena
local sTool, sHead, sTcPos = FindNextToolOnHeadSet( 2, false)
if not dPrevA or not sTool then
-- cambio utensile
EgtSetAxisPos( 'C2', ParkC2)
EgtSetAxisPos( 'B2', ParkB2)
EgtSetAxisPos( 'Z2', MaxZ2)
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
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)
-- 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
if sTcPos then
LoadNextTool( 2, DefTcPos2)
-- se c'è prossimo utensile, oppure se non c'è e c'è un movimento carrelli
if sTool or ( not sTool and bCarrMove) or not bLastRise then
local dHomeX2 = EgtGetAxisHomePos( 'X2')
local dHomeC2 = EgtGetAxisHomePos( 'C2')
local dHomeB2 = EgtGetAxisHomePos( 'B2')
-- cambio utensile
EgtSetAxisPos( 'C2', dHomeC2)
EgtSetAxisPos( 'B2', dHomeB2)
EgtSetAxisPos( 'Z2', MaxZ2)
SimulMoveAxis( 'X2', dHomeX2, MCH_SIM_STEP.RAPID)
if sTcPos then
LoadNextTool( 2, sTcPos)
end
end
EMT.CHSAW_OUT = nil
end
return
end
EMT.CHSAW_OUT = nil
-- 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...')
-- se prossimo utensile sega a catena, devo mettere in home testa 1 e depositare l'utensile sulla testa 2 o viceversa
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
if dHeadSet == 1 then
local nNextHeadSet = GetHeadSet( EMT.NEXTHEAD)
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)
else
elseif nNextHeadSet == 2 then
-- visualizzo utensile su TcPos
ShowToolInTcPos( EMT.PREVTCPOS_H2, true)
-- nascondo l'utensile sulla testa
@@ -1218,7 +1254,7 @@ function OnSimulMoveEnd()
local bLastRise = EgtGetInfo( EMT.MOVEID, 'LastRise', 'b')
-- se ultimo rapido e motosega, si va in home
if bLastRise and HeadIsChainSaw( EMT.HEAD) then
OnSimulToolDeselect( EMT.R3)
OnSimulToolDeselect( EMT.R3, true)
EMT.CHSAW_OUT = true
end
end
@@ -1427,6 +1463,13 @@ end
function ExecMoveHome( bNearV)
-- se richiesto, avvicino i rulli
if bNearV then
-- se ho motosega, devo scaricare
if HeadIsChainSaw( EMT.HEAD) then
-- recupero il valore dell'asse virtuale bloccato A
local dPosA = GetCurrChainSawingVirtualAxis()
OnSimulToolDeselect( dPosA)
EMT.CHSAW_OUT = true
end
-- sistemo i rulli
ExecOpenRoller( 1)
ExecOpenRoller( 2)
@@ -2614,7 +2657,7 @@ function FindNextToolOnHeadSet( nHSet, bFirst)
local CurrMachId = EgtGetCurrMachining()
local CurrTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
-- cerco lavorazione con utensile su gruppo testa indicato
local sTool, sHead, sTcPos
local sTool, sHead, sTcPos, bCarrMove
local OpId
if bFirst then
OpId = EgtGetFirstActiveOperation()
@@ -2627,12 +2670,20 @@ function FindNextToolOnHeadSet( nHSet, bFirst)
if EgtSetCurrMachining( OpId) then
local sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
if EgtTdbSetCurrTool( sNextTool) then
local nClId = EgtGetFirstNameInGroup( OpId, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
if dAuxMoveCount > 3 then
bCarrMove = true
end
local sNextHead = EgtTdbGetCurrToolParam( MCH_TP.HEAD)
if GetHeadSet( sNextHead) == nHSet and EMT.TOOL ~= sNextTool then
if not HeadIsChainSaw( sNextHead) then
sHead = sNextHead
sTool = sNextTool
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
if GetHeadSet( sNextHead) == nHSet then
if CurrTool ~= sNextTool then
if not HeadIsChainSaw( sNextHead) then
sHead = sNextHead
sTool = sNextTool
sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
end
end
break
end
@@ -2641,11 +2692,15 @@ function FindNextToolOnHeadSet( nHSet, bFirst)
end
OpId = EgtGetNextActiveOperation( OpId)
end
-- se non c'è un operazione, significa che è fine pezzo, quindi si forza movimento carrelli perchè avverrà uno scarico
if not OpId then
bCarrMove = true
end
-- ripristino stato iniziale
EgtSetCurrMachining( CurrMachId or GDB_ID.NULL)
EgtTdbSetCurrTool( CurrTool or '')
-- restituisco risultato
return sTool, sHead, sTcPos
return sTool, sHead, sTcPos, bCarrMove
end
---------------------------------------------------------------------
+44 -56
View File
@@ -279,11 +279,10 @@ function OnSpecialLink()
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2p, EMC.L3p, EMC.R1p, EMC.R2p, EMC.R3}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3}, 30, 2, 2)
if abs( EMC.R3) < 0.1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z1, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z1, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
@@ -320,6 +319,8 @@ function OnSpecialLink()
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 30, 3, 2, 'UniqueRise=1;')
end
-- altrimenti collegamento tra due lavorazioni (3)
else
end
-- se fresa su testa 2
@@ -398,9 +399,12 @@ function OnSpecialLink()
EmtRemoveClimb( EMC.NEXTMCHID, EMC.NEXTMAIN)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2p, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, EMC.R2p}, 30, 2, 2)
-- se assi cambiano di molto
if abs( EMC.R1 - EMC.R1p) > 10 or abs( EMC.R2 - EMC.R2p) > 90 then
-- se asse B cambia di molto
if abs( 0 - EMC.R2p) > 1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1p, 0}, 30, 2, 2)
end
-- se assi cambiano di molto
if abs( EMC.R1 - EMC.R1p) > 10 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, 0}, 30, 2, 2)
end
@@ -415,26 +419,16 @@ function OnSpecialLink()
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
-- se assi cambiano di molto
if abs( EMC.R1 - EMC.R1p) > 10 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
-- retrazione
EmtRemoveRise( EMC.PREVMCHID, EMC.PREVMAIN)
if abs( EMC.R1 - EMC.R1p) > 1 or abs( EMC.R2 - EMC.R2p) > 1 then
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, 0}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', '')..'FirstRise=1;')
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, 0}, 30, 3, 2)
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2)
else
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2p, EMC.L3, EMC.R1p, EMC.R2p}, 30, 3, 2, EgtIf( bSplit, 'Split=1;', ''))
end
EmtAddRise( EMC.PREVMCHID, EMC.PREVMAIN, { EMC.L1p, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 3, 2, 'LastRise=1;')
-- altrimenti collegamento tra due lavorazioni (3)
else
-- recupero quota massima di collegamento
@@ -466,6 +460,7 @@ function OnSpecialLink()
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se sega a catena su testa 2
elseif EMC.HEAD == 'H23' then
-- recupero se split da note utente di lavorazione precedente
@@ -477,11 +472,10 @@ function OnSpecialLink()
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2p, EMC.L3p, EMC.R1p, EMC.R2p, EMC.R3}, 30, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2p, EMC.R3}, 30, 2, 2)
if abs( EMC.R3) < 0.1 then
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z2, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, ParkCSaw0Z2, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
else
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 30, 2, 2)
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3p, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
end
EmtAddClimb( EMC.NEXTMCHID, EMC.NEXTMAIN, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2, EMC.R3}, 31, 2, 2, 'LastClimb=1;')
-- se fine lavorazione con deposito utensile
elseif EMC.LINKTYPE == 2 then
@@ -533,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
@@ -591,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)
@@ -1293,13 +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)
-- se testa oltre lo zero
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 then
-- si sposta testa in posizione carico
table.insert( vCmd, { 24, 'T', ParkV1, 'Y1', ParkV1 + dLastY1Delta})
-- 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
+4 -3
View File
@@ -32,9 +32,9 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1f1_RC11'
PP_NVER = '3.1.6.1'
MIN_MACH_VER = '2.7a1'
PP_VER = '3.1h1'
PP_NVER = '3.1.8.1'
MIN_MACH_VER = '3.1f4'
MACH_NAME = EgtGetCurrMachineName()
@@ -950,6 +950,7 @@ function OnSetHead()
end
---------------------------------------------------------------------
-------------------------- Testa utilizzata -------------------------
function GetHeadSet( sHead)
if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H15' or sHead == 'H17' then
return 1
+37 -1
View File
@@ -1,10 +1,46 @@
==== Common_ONE-PF Update Log ====
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
- (SIM) Corretta gestione scarico motosega in caso di cambio pinze dopo che utensile già caricato. In generazione era corretto perchè selezione utensile avviene già dopo posizionamento carrelli
- (SIM-GEN) Migliorati movimenti lama e motosega. Ultimo punto climb motosega è in alto in quota parcheggio.
- (GEN) Corretta scrittura piano lavorazione in caso di rotazione con pezzo con sovramateriale in testa. Ticket#3092
Versione 3.1g2 (07/07/2026)
- (SIM) Corretta gestione cambio utensile con motosega
Versione 3.1g1 (07/07/2026)
- (ALL) Prima versione con gestione nuovi link (no tastatore)
- Gestione lavorazioni in doppio
- Preselezione utensile gestibile da parametri TS3
- Gestione Drilling e Pocketing NT
Versione 3.1f5 (26/06/2026)
- (SIM-GEN) Se tasca con motosega in faccia sopra e pezzo alto, si ruota in sicurezza.
Versione 3.1f4 (17/06/2026)
- (MLDE-GEN) Corretta preselezione in caso di testa in lavoro troppo vicina a quella che sta preselezionando. Da aggiungere in MLDE parametri 'Limit_T1_Presel_T2' e 'Limit_T2_Presel_T1'
Versione 3.1f3 (08/06/2026)
- (GEN) M77 viene ora eseguita, prima era commentata.
Versione 3.1f2 (05/06/2026)
- (MLDE-GEN) Aggiunti parametri di limite asse X per decidere se fare preselezione su altra testa. Serve modifica MLDE
Versione 3.1f1 (03/06/2026)
- (NGE-MLDE-GEN-SIM) Versione unificata con predisposizione per gestione tastatori. Serve modificare anche la macchina, per ora gestione completa solo su PFrl.
Versione 3.1c2 (17/03/2026)
- (SIM-GEN) Aggiunta OnSpecialApplyMachining per calcolare i carrelli da subito
- Aggiungendo OnSpecialApplyMachining, ora la OnSpecialGetPrevMachiningOffset lavora correttamente. ATT: MIN_MACH -> 3.1b2
Versione 3.1c1 (04/03/2026)
- (GEN) Corretta chiamata di una variabile insesistente in caso di ONE
- (SIM) Allineata simulazione a generazione
+2 -2
View File
@@ -3,8 +3,8 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '3.1c2', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
VERSION = '3.1h1', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1f1' -- versione minima kernel
}
return InfoCommon_STD_PP