Compare commits

...

6 Commits

Author SHA1 Message Date
daniele.nicoli c78c2412a5 OnRapid() se presenti movimenti dei carrelli resetta piano di lavorazione 2026-05-28 10:09:38 +02:00
daniele.nicoli 1c0cfdfd22 Forza scrittura di tutti gli assi lineari nel G142 2026-05-27 11:46:43 +02:00
daniele.nicoli 7e977d81cb Cambio versione 2026-05-27 08:31:19 +02:00
daniele.nicoli 6cdb3888a0 Aggiunto UniqueRise per l'emissione di Start e Wait Head( nHSet) 2026-05-26 17:19:36 +02:00
andrea.villa e0dfd45f1c Corretto comando allo split che muove entrambe le pinze 2026-05-26 11:23:07 +02:00
andrea.villa 799b5aead7 Corretto reset piano generico 2026-05-25 17:35:52 +02:00
2 changed files with 49 additions and 15 deletions
+48 -14
View File
@@ -485,6 +485,7 @@ end
---------------------------------------------------------------------
function OnMachiningEnd()
--EmtOutput( ';Mach End')
local bMoveBothClampsOnSplit = false
if #EMT.MDCHAR > 0 then
-- Emissione split
if EMT.AUXTYPE == 'S' then
@@ -515,6 +516,7 @@ function OnMachiningEnd()
EMT.MDCHAR[1].MovType = nil
EMT.MDCHAR[1].Y2 = ParkV2 - EMT.LT + EMT.Y2DELTA
EMT.MDCHAR[1].V2 = ParkV2
bMoveBothClampsOnSplit = true
end
end
@@ -558,8 +560,13 @@ function OnMachiningEnd()
end
if #EMT.MDCHAR > 0 then
if EMT.AUXTYPE == 'S' then
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
if bMoveBothClampsOnSplit then
EmitMoveStartChars( 3)
EmitMoveWaitChars( 3)
else
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
end
elseif EMT.AUXTYPE == 'U' then
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
@@ -857,8 +864,10 @@ function OnRapid()
EmitMoveWaitChars( EgtIf( bOnlyCharY, 1, 3))
else
-- se stesso utensile, e c'è ancora piano attivo dalla lavorazione precedente, allora questo è un climb
if EMT.TOOL == EMT.PREVTOOL and EMT.PLANEACTIVE and ( abs( EMT.R1prec - EMT.R1) < 0.1 and abs( EMT.R2prec - EMT.R2) < 0.1) then
-- controllo se ci sono spostamenti dei carrelli programmati
local bChangeCarriageClamping = CheckChangeCarriageClamping()
-- se non ci sono riposizionamenti dei carrelli, se stesso utensile, e c'è ancora piano attivo dalla lavorazione precedente, allora questo è un climb
if not bChangeCarriageClamping and EMT.TOOL == EMT.PREVTOOL and EMT.PLANEACTIVE and ( abs( EMT.R1prec - EMT.R1) < 0.1 and abs( EMT.R2prec - EMT.R2) < 0.1) then
-- dichiaro finita lavorazione precedente
local sOut = 'G157 EA1'
EmtOutput( sOut)
@@ -890,11 +899,6 @@ function OnRapid()
-- dichiaro che è un movimento standard
bStdMachRapid = true
else
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
if bStdMachRapid then
bStdMachRapid = false
bStdClimb = true
@@ -904,6 +908,11 @@ function OnRapid()
if EMT.PLANEACTIVE then
EmitResetMachining( false)
end
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmtResetPrev()
EmtOutput( '( *** '..EMT.MCHNAME..'/'..EMT.TOOL..' *** )')
-- eventuale movimento carrelli
for i = 1, #EMT.AUXCMD do
@@ -982,10 +991,10 @@ function OnRapid()
end
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- se ultimo rapido e motosega, si va in home
EmitMoveDataHead( nHSet, { X=EMT.L2, Z=EMT.L3, C=EMT.R1, B=EMT.R2})
-- su ultimo rapido in uscita, comandi di attesa movimenti
if bLastRise or bStdRise then
if bLastRise or bUniqueRise or bStdRise then
EmitMoveStartHead( nHSet)
-- se lavorazione in doppio
if nHSet == 1 and EMT.DOU_TYPE == 2 then
@@ -1150,14 +1159,15 @@ function OnRapid()
-- trasformo i punti nel piano
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
-- annullo precedenti per forzare scrittura
EMT.L1p = nil
EMT.L2p = nil
EMT.L3p = nil
local sDouFlag = EgtIf( EMT.DOU_TYPE, ' EE1', '')
EmtOutput( 'G142'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..EgtIf( nHSet~=2, ' EU1', ' EU2')..sDouFlag..' EF'..GetFmaxClamp())
EMT.PLANEACTIVE = true
-- EMT.L1p = nil
-- EMT.L2p = nil
-- EMT.L3p = nil
-- annullo precedenti per forzare scrittura
EMT.R1p = nil
EMT.R2p = nil
@@ -1370,6 +1380,28 @@ function CalcCharStatusN( sCmd)
end
end
---------------------------------------------------------------------
-- controlla se nella tabella AUX sono presenti dei movimenti dei carrelli
function CheckChangeCarriageClamping()
local ChangeCarriagesParam = {
'1', -- movimento singolo carro
'2', -- movimento carro e trave
'3', -- movimento 2 carri e trave
'4', -- risalita a Z max
'11', -- comando pinza 1
'12' -- comando pinza 2
}
for i=1, #EMT.AUXCMD do
local Cmd = EgtSplitString( EMT.AUXCMD[i])
for j=1, #ChangeCarriagesParam do
if Cmd[1] == ChangeCarriagesParam[j] then
return true
end
end
end
return false
end
---------------------------------------------------------------------
function PrepareLoad( sCmd, nInd, bStart)
local Cmd = EgtSplitString( sCmd)
@@ -2296,6 +2328,8 @@ function EmitResetMachining( bNextTool)
EmtOutput( 'G157 EA1')
-- piano non più attivo
EMT.PLANEACTIVE = false
EMT.REFLOC = nil
EMT.IPLGL = false
end
end
+1 -1
View File
@@ -32,7 +32,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1e1_NL6'
PP_VER = '3.1e1_NL10'
PP_NVER = '3.1.3.2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = EgtGetCurrMachineName()