diff --git a/Common_ONE-PF.NUM.mlpe b/Common_ONE-PF.NUM.mlpe index fbabc3c..9b8f03e 100644 --- a/Common_ONE-PF.NUM.mlpe +++ b/Common_ONE-PF.NUM.mlpe @@ -28,6 +28,9 @@ function OnStart() --EMT.Ft = 'F' -- token per feed --EMT.St = 'S' -- token per speed EMT.FMAXPINZE = 102000 -- feed massima pinze + -- utensili default + EMT.PREVTCPOS_H1 = DefTcPos1 + EMT.PREVTCPOS_H2 = DefTcPos2 end --------------------------------------------------------------------- @@ -599,6 +602,18 @@ function OnMachiningEnd() EMT.PREVTOOL = EMT.TOOL EMT.PREVHEAD = EMT.HEAD EMT.PREVTCPOS = EMT.TCPOS + -- salvo anche utlimo utensile su testa + local nHSet = GetHeadSet( EMT.HEAD) + if nHSet == 1 then + EMT.PREVTOOL_H1 = EMT.TOOL + EMT.PREVHEAD_H1 = EMT.HEAD + EMT.PREVTCPOS_H1 = EMT.TCPOS + elseif nHSet == 2 then + EMT.PREVTOOL_H2 = EMT.TOOL + EMT.PREVHEAD_H2 = EMT.HEAD + EMT.PREVTCPOS_H2 = EMT.TCPOS + end + if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end EMT.DOU_TYPE = nil end @@ -1064,42 +1079,42 @@ function OnRapid() EMT.AUXCMD = {} -- se necessario posizionamento in home (sono sicuramente già a Zmax) if EMT.TO_XHOME then - -- se precedente non era sega a catena, vado in home con quella - if not HeadIsChainSaw( EMT.PREVHEAD) then - local nPrevHSet = GetHeadSet( EMT.PREVHEAD) - if nPrevHSet == 1 then + local nHSet = GetHeadSet( EMT.HEAD) + local nPrevHSet = GetHeadSet( EMT.PREVHEAD) + + -- se successivo non è sega a catena e la testa è la stessa, vado in home con utensile successivo + if not HeadIsChainSaw( EMT.HEAD) and nHSet == nPrevHSet then + if nHSet == 1 then local HomeX1 = EgtGetAxisHomePos( 'X1') - EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'}) + EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1}) EmitMoveStartHead( 1, 'EA1') else local HomeX2 = EgtGetAxisHomePos( 'X2') - EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'}) + EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2}) EmitMoveStartHead( 2, 'EA1') end - -- altrimenti la deposito e vado in home speciale else - -- se successivo non è sega a catena, ne lancio il carico - if not HeadIsChainSaw( EMT.HEAD) then - if nHSet == 1 then + if not HeadIsChainSaw( EMT.PREVHEAD) then + if nPrevHSet == 1 then local HomeX1 = EgtGetAxisHomePos( 'X1') - EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=HomeR2, C=HomeR1}) + EmitMoveDataHead( 1, { X=-HomeX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)}) EmitMoveStartHead( 1, 'EA1') else local HomeX2 = EgtGetAxisHomePos( 'X2') - EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=HomeR2, C=HomeR1}) + EmitMoveDataHead( 2, { X=-HomeX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)}) EmitMoveStartHead( 2, 'EA1') end - -- altrimenti deposito e mi metto in posizione sicura else - if GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC2' then - EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='0'}) + if GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC1' or GetHeadTCSet( EMT.PREVHEAD, EMT.PREVTCPOS) == 'Head1_TC2' then + EmitMoveDataHead( 1, { X=-ParkCSawX1S, Z=MaxZ1, B=HomeR2, C=HomeR1, TPos='50'}) EmitMoveStartHead( 1, 'EA1') else - EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='0'}) + EmitMoveDataHead( 2, { X=-ParkCSawX2S, Z=MaxZ2, B=HomeR2, C=HomeR1, TPos='50'}) EmitMoveStartHead( 2, 'EA1') end end end + EMT.TO_XHOME = nil EMT.L3pp = nil PrevR1 = HomeR1 @@ -2867,11 +2882,11 @@ function PreselectNextDiffHead( nMchId, sHead) local sNextTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS) -- se testa attuale da caricare è sega a catena, mando l'altra prima in HomeX (per evitare possibili collisioni) e poi lancio preselezione if sHead == 'H13' and EMT.PREVHEAD ~= 'H13' then - EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'}) + EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)}) EmitMoveStartHead( 2) EmitMoveWaitHead( 2) elseif sHead == 'H23' and EMT.PREVHEAD ~= 'H23' then - EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'}) + EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)}) EmitMoveStartHead( 1) EmitMoveWaitHead( 1) end @@ -2904,15 +2919,16 @@ function PreselectNextDiffHead( nMchId, sHead) -- mi assicuro che l'altra testa sia in parcheggio if nHSet == 1 then -- non può essere la sega a catena - EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos='0'}) - EmitMoveStartHead( 2) - if EMT.PREVHEAD == 'H23' and EMT.PREVHEAD ~= EMT.HEAD then - EmitMoveWaitHead( 2) + if EMT.PREVHEAD_H2 ~= 'H23' then + EmitMoveDataHead( 2, { X=-ParkX2, Z=MaxZ2, B=ParkB2, C=ParkC2, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H2)}) + EmitMoveStartHead( 2) end else - -- va bene per frese e lama - EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos='0'}) - EmitMoveStartHead( 1) + -- non può essere la sega a catena + if EMT.PREVHEAD_H1 ~= 'H13' and EMT.PREVHEAD_H1 ~= 'H15' then + EmitMoveDataHead( 1, { X=-ParkX1, Z=MaxZ1, B=ParkB1, C=ParkC1, TPos=AdjustTcPos( false, EMT.PREVTCPOS_H1)}) + EmitMoveStartHead( 1) + end end end end diff --git a/Essetre-PF.mlde b/Essetre-PF.mlde index 970f444..5054e1e 100644 --- a/Essetre-PF.mlde +++ b/Essetre-PF.mlde @@ -59,13 +59,14 @@ -- Aggiunta variabile WoodDensity per gestione WOOD_DENSITY -- 2024/06/03 ver 2.6f1 Aggiunta funzione GetSetupInfo a BeamData per nuovo automatismo -- Allineamento con common ver. 2.6f1 --- 2024/04/12 ver 2.6g1 Allineamento con common ver. 2.6g1 +-- 2024/07/10 ver 2.6g1 Allineamento con common ver. 2.6g1 +-- 2024/07/16 ver 2.6g2 Allineamento con common ver. 2.6g2 -- Intestazioni require( 'EmtGenerator') EgtEnableDebug( false) -PP_VER = '2.6g1' +PP_VER = '2.6g2' MIN_MACH_VER = '2.5k1' MACH_NAME = 'Essetre-PF' diff --git a/UpdateLog.txt b/UpdateLog.txt index 40bdb42..2a4ec56 100644 --- a/UpdateLog.txt +++ b/UpdateLog.txt @@ -1,5 +1,8 @@ ==== Common_ONE-PF Update Log ==== +Versione 2.6g2 (16/07/2024) +- (GEN) Per preselezione o movimenti in home, non si scrive più 'ET0' perchè non è più supportato. Ticket#1926 + Versione 2.6g1 (10/07/2024) - (GEN) Se prima lavorazione con motosega, dopo G151 di attesa carrelli si ribadiscono tutti gli assi. Ticket#1924 diff --git a/Version.lua b/Version.lua index dabf2e5..d4bc326 100644 --- a/Version.lua +++ b/Version.lua @@ -3,7 +3,7 @@ local InfoCommon_STD_PP = { NAME = 'Common_ONE-PF', -- nome script PP standard - VERSION = '2.6g1', -- versione script + VERSION = '2.6g2', -- versione script MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel }