diff --git a/Common_PF1250.TPA.mlpe b/Common_PF1250.TPA.mlpe index 54231f2..091b3df 100644 --- a/Common_PF1250.TPA.mlpe +++ b/Common_PF1250.TPA.mlpe @@ -915,7 +915,7 @@ function OnRapid() elseif EgtGetHeadId( 'H38') then local B3Home = EgtGetAxisHomePos( 'B3') local C3Home = EgtGetAxisHomePos( 'C3') - EmitMoveDataHead( 3, { X=SafeX3RotAxis, S=Speed}) + EmitMoveDataHead( 3, { X=-SafeX3RotAxis, S=Speed}) -- se non sono esattamente in home, devo ruotare in zona sicura if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then EMT.L3 = min( EMT.L3, SafeZ3RotAxis) @@ -1256,7 +1256,7 @@ function OnRapid() if EMT.ZMAX or ( EMT.FLAG == 2 and EMT.FLAG2 == 1) then local B3Home = EgtGetAxisHomePos( 'B3') local C3Home = EgtGetAxisHomePos( 'C3') - EmitMoveDataHead( 3, { X=SafeX3RotAxis, S=Speed}) + EmitMoveDataHead( 3, { X=-SafeX3RotAxis, S=Speed}) -- se non sono esattamente in home, devo ruotare in zona sicura if abs( C3Home - EMT.R1) > 1 or abs( B3Home - EMT.R2) > 1 then EMT.L3 = min( EMT.L3, SafeZ3RotAxis) @@ -1417,7 +1417,9 @@ function OnRapid() local bSplitCut = ( EMT.MCHUSERNOTES:find( 'Split', 1, true) ~= nil) -- porto in home la testa corrente se lavorazione successiva sopra con testa diversa oppure se punta lunga local nNextTopHSet = GetNextTopHSet( EMT.MCHID) - local bTopGoHome = ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet) or ( nHSet == 1 and EMT.TTOTLEN > LongTool) + -- ricavo prossimo utensile + local sNextTool = GetNextTool( EMT.MCHID) + local bTopGoHome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) or ( nHSet ~= 2 and nNextTopHSet ~= 0 and nHSet ~= nNextTopHSet) or ( nHSet == 1 and EMT.TTOTLEN > LongTool) EmitZmax( true, true, EMT.R1p, EMT.R2p, bSplitCut, bTopGoHome, false) -- aggiorno quota finale trave dopo Zmax EMT.L1o = EMT.TPOS @@ -2551,7 +2553,7 @@ function EmitZmax( bReset, bEnd, PrevR1, PrevR2, bSplitCut, bTopGoHome, bUsePrev end -- se non sono esattamente in home, devo ruotare in zona sicura if abs( dHomeC3 - PrevR1) > 1 or abs( dHomeB3 - PrevR2) > 1 then - EmitMoveDataHead( 3, { X=SafeX3RotAxis, Fmt=1}) + EmitMoveDataHead( 3, { X=-SafeX3RotAxis, Fmt=1}) EmitMoveDataHead( 3, { Z=SafeZ3RotAxis, Fmt=1}) EmitMoveDataHead( 3, { B=dHomeB3, C=dHomeC3, Fmt=1}) end @@ -2840,9 +2842,11 @@ function PreselectNextDiffHead( nMchId, sHead) EmitMoveDataHead( 1, { X=EgtIf( bXSpec, -DeltaTabY, dNextX), B=ParkCSawB1, C=MyParkCSawC1, TPos=AdjustTcPos( false, sNextTcPos, dPosA), Fmt=2}) EmitMoveStartHead( 1) end - else + elseif nNextHSet == 2 then EmitMoveDataHead( 2, { B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, sNextTcPos), Fmt=2}) EmitMoveStartHead( 2) + else + ; -- non si preseleziona testa 3 end end end diff --git a/Common_PF1250.mlpe b/Common_PF1250.mlpe index 568d5c5..1f60d71 100644 --- a/Common_PF1250.mlpe +++ b/Common_PF1250.mlpe @@ -1251,6 +1251,8 @@ end --------------------------------------------------------------------- function OnSimulMoveEnd() + -- gruppo della testa + local nHSet = GetHeadSet( EMT.HEAD) -- rimozione eventuali sfridi if EMT.FLAG == 301 then ExecRemoveScraps() @@ -1295,8 +1297,12 @@ function OnSimulMoveEnd() if EMT.MOVE == 0 and EMT.FLAG == 3 then -- eventuale rimozione sfridi ExecRemoveScraps() + -- ricavo prossimo utensile + local sNextTool = GetNextTool( EMT.MCHID) + -- vado in home se è ultimo movimento ed è ultima lavorazione + local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool and nHSet == 3) -- eseguo - ExecMoveZmax( EMT.MCHSPLIT) + ExecMoveZmax( EMT.MCHSPLIT, bToXhome) EMT.TO_ZMAX = nil end end @@ -1474,7 +1480,7 @@ end --------------------------------------------------------------------- function ExecMoveHome( bNearV, bMchSplit) -- risalita a Zmax - ExecMoveZmax( bMchSplit) + ExecMoveZmax( bMchSplit, true) -- se testa sotto e macchian a 3 teste e gruppo truciolatore a 4 assi if GetHeadSet( EMT.HEAD) == 2 and IsHeadExisting( 3) then if not SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID) then @@ -1499,7 +1505,7 @@ function ExecMoveHome( bNearV, bMchSplit) end --------------------------------------------------------------------- -function ExecMoveZmax( bMchSplit) +function ExecMoveZmax( bMchSplit, bGoToHome) -- set della testa local nSetHead = GetHeadSet( EMT.HEAD) -- posizioni correnti degli assi testa @@ -1586,6 +1592,9 @@ function ExecMoveZmax( bMchSplit) SimulMoveAxes( 'C3', HomeC, MCH_SIM_STEP.COLLROT, 'B3', HomeB, MCH_SIM_STEP.COLLROT) end SimulMoveAxis( 'Z3', MyMaxZ3, MCH_SIM_STEP.RAPID) + if bGoToHome then + SimulMoveAxis( 'X3', ParkX3, MCH_SIM_STEP.RAPID) + end else EmtSetLastError( 1212, "HEAD not managed") end @@ -2645,6 +2654,11 @@ function GetStartMachiningXaxis( nMchId) end end +--------------------------------------------------------------------- +function IsLastPath( nPathId) + return not EgtGetNext( nPathId) +end + --------------------------------------------------------------------- function RollerParkingNeeded( sHead, dAng1p, dAng2p, dAng1, dAng2) if sHead == 'H11' or sHead == 'H12' or sHead == 'H13' or sHead == 'H16' then diff --git a/Essetre-PF1500MAXrl-3T.mlde b/Essetre-PF1500MAXrl-3T.mlde index b3e9c45..4af1fe7 100644 --- a/Essetre-PF1500MAXrl-3T.mlde +++ b/Essetre-PF1500MAXrl-3T.mlde @@ -5,7 +5,7 @@ require( 'EmtGenerator') EgtEnableDebug( false) -PP_VER = '2.6k2_DEV8' +PP_VER = '2.6k2_DEV9' PP_NVER = '2.6.11.2' MIN_MACH_VER = '2.5k1' MACH_NAME = 'Essetre-PF1500MAXrl-3T' @@ -130,7 +130,7 @@ ParkZ3 = -200 ParkC3 = -90 ParkB3 = -75 SafeX3RotAxis = 1600 -SafeZ3RotAxis = -620 +SafeZ3RotAxis = -655 MinX2 = -3060 MaxX2 = 0 MinZ2 = 0 diff --git a/THolders/Standard97.nge b/THolders/Standard97.nge new file mode 100644 index 0000000..2ab70eb Binary files /dev/null and b/THolders/Standard97.nge differ diff --git a/THolders/Standard_78.nge b/THolders/Standard_78.nge new file mode 100644 index 0000000..bb1e695 Binary files /dev/null and b/THolders/Standard_78.nge differ diff --git a/THolders/Standard_LC.nge b/THolders/Standard_LC.nge new file mode 100644 index 0000000..7d2b4c3 Binary files /dev/null and b/THolders/Standard_LC.nge differ