Compare commits

..

2 Commits

Author SHA1 Message Date
andrea.villa fbae1a4ce1 Corretta preselezione in caso di testa in lavoro troppo vicina a quella che sta preselezionando 2026-06-17 08:42:41 +02:00
andrea.villa ee90ea7376 M77 viene ora eseguita, prima era commentata 2026-06-08 14:25:22 +02:00
3 changed files with 51 additions and 19 deletions
+44 -18
View File
@@ -422,6 +422,14 @@ function OnToolSelect()
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
EMT.ISPROBING = HeadIsProbe( EMT.HEAD)
-- gruppo della testa
local nHSet = GetHeadSet( EMT.HEAD)
if nHSet == 1 and EMT.PRESEL_H1 then
EMT.PRESEL_H1 = nil
elseif nHSet == 2 and EMT.PRESEL_H2 then
EMT.PRESEL_H2 = nil
end
end
end
@@ -597,7 +605,7 @@ function OnMachiningEnd()
EmtOutput( sOut)
end
elseif not EMT.PREROT then
EmtOutput( '(M77)')
EmtOutput( 'M77')
end
end
end
@@ -3382,12 +3390,14 @@ function PreselectNextDiffHead( nMchId, sHead)
local nHSet = GetHeadSet( sHead)
local bVerifyPresel = true
-- se lavorazione con testa 1 e sotto al limite massimo di preselezione della testa 2, allora non si fa preselezione
if nHSet == 1 and Limit_T1_Presel_T2 and EMT.MAXMIN[2] < Limit_T1_Presel_T2 then
bVerifyPresel = false
-- se lavorazione con testa 1 e sopra al limite minimo di preselezione della testa 1, allora non si fa preselezione
elseif nHSet == 2 and Limit_T2_Presel_T1 and EMT.MAXMIN[2] > Limit_T2_Presel_T1 then
bVerifyPresel = false
if not EMT.LOAD then
-- se lavorazione con testa 1 e sotto al limite massimo di preselezione della testa 2, allora non si fa preselezione
if nHSet == 1 and Limit_T1_Presel_T2 and EMT.MAXMIN[2] < Limit_T1_Presel_T2 then
bVerifyPresel = false
-- se lavorazione con testa 1 e sopra al limite minimo di preselezione della testa 1, allora non si fa preselezione
elseif nHSet == 2 and Limit_T2_Presel_T1 and EMT.MAXMIN[2] > Limit_T2_Presel_T1 then
bVerifyPresel = false
end
end
-- flag preselezione eseguita
@@ -3456,20 +3466,36 @@ function PreselectNextDiffHead( nMchId, sHead)
end
-- se non eseguita preselezione
if not bPresel then
-- mi assicuro che l'altra testa sia in parcheggio
if nHSet == 1 then
-- non può essere la sega a catena
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
-- se era stato preselezionato un utensile e adesso non posso preselezionare, attendo la testa
if EMT.PRESEL_H2 then
EmitMoveWaitHead( 2)
EMT.PRESEL_H2 = nil
elseif EMT.PRESEL_H1 then
EmitMoveWaitHead( 1)
EMT.PRESEL_H1 = nil
-- se non era stato preselezionato nulla
else
-- 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)
-- mi assicuro che l'altra testa sia in parcheggio
if nHSet == 1 then
-- non può essere la sega a catena
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
-- 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
else
if nHSet == 1 then
EMT.PRESEL_H2 = true
elseif nHSet == 1 then
EMT.PRESEL_H2 = true
end
end
end
+6
View File
@@ -1,5 +1,11 @@
==== Common_ONE-PF Update Log ====
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
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '3.1f2', -- versione script
VERSION = '3.1f4', -- versione script
MIN_MACH_VER_PP_COMMON = '3.1b2' -- versione minima kernel
}