Compare commits
1 Commits
3.1e1_DEV3
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 38bb400286 |
+148
-146
@@ -591,85 +591,178 @@ function OnRapid()
|
||||
--EMT.ZMAX = true
|
||||
EMT.PREVTOOL = EMT.TOOL
|
||||
end
|
||||
|
||||
-- se si spostano i carrelli, si chiude lavorazione precedente
|
||||
if bMoveChar then
|
||||
local bStoPre
|
||||
if EMT.CHAN2 then
|
||||
-- MyEmtOutput( 'WAIT_CHAN(2)')
|
||||
MyEmtOutput( 'STOPRE')
|
||||
bStoPre = true
|
||||
EMT.CHAN2 = nil
|
||||
end
|
||||
if EMT.TRAILON then
|
||||
MyEmtOutput( 'TRAILOF(X2,X1)')
|
||||
MyEmtOutput( 'STOPRE')
|
||||
MyEmtOutput( 'TRANS')
|
||||
bStoPre = true
|
||||
EMT.TRAILON = nil
|
||||
end
|
||||
--if not bStoPre then MyEmtOutput( 'STOPRE') end
|
||||
--MyEmtOutput( '')
|
||||
end
|
||||
|
||||
-- se c'è un movimento carrelli
|
||||
if bMoveChar then
|
||||
if not EMT.TSELECT then
|
||||
EMT.NSTEP = EMT.NSTEP + 10
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_STEP='..sStep)
|
||||
local sStep1 = EgtNumToString( EMT.NSTEP + 1, 0)
|
||||
MyEmtOutput( 'GOTOF '..'_N'..sStep1)
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
local sOut = 'PRE_WORK(1,1,' .. EMT.TOOLSEL .. ','..EgtNumToString( EMT.S, 0) ..',,,,)'
|
||||
MyEmtOutput( sOut)
|
||||
EMT.SPEED_ON = true
|
||||
MyEmtOutput( '_N'..sStep1..':STOPRE')
|
||||
end
|
||||
MyEmtOutput( 'WAIT_CHAN(2)')
|
||||
end
|
||||
|
||||
EMT.NSTEP = EMT.NSTEP + 10
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_STEP='..sStep)
|
||||
local sOut = EMT.MCHNAME..'/'..EMT.TOOL
|
||||
MyEmtOutput( '\n; *** ' .. sOut .. ' ***')
|
||||
-- movimento carrelli
|
||||
|
||||
-- se ci sono movimenti carrelli
|
||||
EMT.AUXCMD = {}
|
||||
for i = 1, #EMT.AUXSTR do
|
||||
MyEmtOutput( EMT.AUXSTR[i])
|
||||
if EMT.AUXSTR and #EMT.AUXSTR > 0 then
|
||||
EMT.NSTEP = EMT.NSTEP + 10
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_STEP='..sStep)
|
||||
for i = 1, #EMT.AUXSTR do
|
||||
MyEmtOutput( EMT.AUXSTR[i])
|
||||
end
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
end
|
||||
|
||||
EMT.AUXSTR = {}
|
||||
EMT.POSTROT = false
|
||||
EMT.RELOAD = false
|
||||
EMT.RELOAD2 = nil
|
||||
EMT.CHAN2 = bMoveChar
|
||||
|
||||
end
|
||||
-- se utensile appena selezionato, lo devo dichiarare
|
||||
if EMT.TSELECT then
|
||||
EMT.TSELECT = nil
|
||||
if bMoveChar then
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
end
|
||||
local sOut = 'PRE_WORK(1,1,' .. EMT.TOOLSEL .. ','..EgtNumToString( EMT.S, 0) ..',,,,)'
|
||||
MyEmtOutput( sOut)
|
||||
EMT.SPEED_ON = true
|
||||
-- eventuali emissioni per ripartenza successiva al carico
|
||||
elseif bMoveChar then
|
||||
local sStep1 = EgtNumToString( EMT.NSTEP + 1, 0)
|
||||
|
||||
-- gestione ripartenza
|
||||
EMT.NSTEP = EMT.NSTEP + 10
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_STEP='..sStep)
|
||||
local sStep1 = EgtNumToString( EMT.NSTEP + 1, 0)
|
||||
if not EMT.LOAD then
|
||||
MyEmtOutput( 'GOTOF '..'_N'..sStep1)
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
local sOut = 'PRE_WORK(1,1,' .. EMT.TOOLSEL .. ','..EgtNumToString( EMT.S, 0) ..',,,,)'
|
||||
MyEmtOutput( sOut)
|
||||
EMT.SPEED_ON = true
|
||||
MyEmtOutput( '_N'..sStep1..':STOPRE')
|
||||
else
|
||||
local sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
end
|
||||
|
||||
sStep = EgtNumToString( EMT.NSTEP, 0)
|
||||
MyEmtOutput( '; se ripartenza')
|
||||
MyEmtOutput( '_N'..sStep..':STOPRE')
|
||||
local sOut = 'PRE_WORK(1,1,' .. EMT.TOOLSEL .. ','..EgtNumToString( EMT.S, 0) ..',,,,)'
|
||||
MyEmtOutput( sOut)
|
||||
-- eventuale avvio mandrino (se non già avviato)
|
||||
EmitSpeedOn( EMT.S)
|
||||
-- EmitSpeedOn( EMT.S)
|
||||
|
||||
-- si ripete macro di carico con opzione di precarico eseguito
|
||||
if EMT.LOAD then
|
||||
MyEmtOutput( EMT.PRELOADCMD)
|
||||
EMT.PRELOADCMD = nil
|
||||
end
|
||||
|
||||
sOut = 'G1 Y=' .. EgtNumToString( EMT.L2, 3)..' A1='..EgtNumToString( EMT.R2, 3)..' C1='..EgtNumToString( EMT.R1, 3) .. ' F' .. EgtNumToString( FmaxY, 3)
|
||||
MyEmtOutput( sOut)
|
||||
|
||||
if EMT.LOAD then
|
||||
MyEmtOutput( 'WAIT_CHAN(2)')
|
||||
EMT.CHAN2 = nil
|
||||
end
|
||||
|
||||
if EMT.X1DELTA and EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X1,X2)')
|
||||
MyEmtOutput( 'STOPRE')
|
||||
MyEmtOutput( 'TRAILON(X2,X1)')
|
||||
EMT.TRAILON = true
|
||||
elseif EMT.X1DELTA then
|
||||
MyEmtOutput( 'GET(X1)')
|
||||
elseif EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X2)')
|
||||
end
|
||||
|
||||
-- se stato pinza attiva non coerente con master, si riscrivono gli assi
|
||||
if EMT.X1DELTA then
|
||||
MyEmtOutput( 'GEOAX(1,X1,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
elseif EMT.X2DELTA then
|
||||
MyEmtOutput( 'GEOAX(1,X2,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
end
|
||||
|
||||
if not EMT.LOAD then
|
||||
local sStep2 = EgtNumToString( EMT.NSTEP + 2, 0)
|
||||
MyEmtOutput( 'GOTOF '..'_N'..sStep2)
|
||||
MyEmtOutput( '; ciclo standard')
|
||||
MyEmtOutput( '_N'..sStep1..':STOPRE')
|
||||
if EMT.TSELECT then
|
||||
sOut = 'PRE_WORK(1,1,' .. EMT.TOOLSEL .. ','..EgtNumToString( EMT.S, 0) ..',,,,)'
|
||||
MyEmtOutput( sOut)
|
||||
end
|
||||
|
||||
if bMoveChar then
|
||||
sOut = 'G1 Y=' .. EgtNumToString( EMT.L2, 3)..' A1='..EgtNumToString( EMT.R2, 3)..' C1='..EgtNumToString( EMT.R1, 3) .. ' F' .. EgtNumToString( FmaxY, 3)
|
||||
MyEmtOutput( sOut)
|
||||
MyEmtOutput( 'WAIT_CHAN(2)')
|
||||
|
||||
-- dopo aver spostato i carrelli, lancio precarico
|
||||
-- se taglio di coda senza residuo da scaricare, emetto macro per accelerare il carico della barra successiva
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and not EMT.PRELOAD then
|
||||
EMT.PRELOAD = true
|
||||
MyEmtOutput( '_POSIZ_T(4,,,,,,,,,)') -- Lancio macro per carico anticipato: i valori sono presi dal plc (passati dall'interfaccia)
|
||||
end
|
||||
|
||||
EMT.CHAN2 = nil
|
||||
if EMT.X1DELTA and EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X1,X2)')
|
||||
MyEmtOutput( 'STOPRE')
|
||||
MyEmtOutput( 'TRAILON(X2,X1)')
|
||||
EMT.TRAILON = true
|
||||
elseif EMT.X1DELTA then
|
||||
MyEmtOutput( 'GET(X1)')
|
||||
elseif EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X2)')
|
||||
end
|
||||
-- se stato pinza attiva non coerente con master, si riscrivono gli assi
|
||||
if EMT.X1DELTA or EMT.X2DELTA then
|
||||
if EMT.X1DELTA and not EMT.X1MASTER then
|
||||
EMT.X1MASTER = true
|
||||
MyEmtOutput( 'GEOAX(1,X1,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
elseif EMT.X2DELTA and ( EMT.X1MASTER and not EMT.X1DELTA) then
|
||||
EMT.X1MASTER = false
|
||||
MyEmtOutput( 'GEOAX(1,X2,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
end
|
||||
end
|
||||
-- primo posizionamento carrello rispetto a 0M
|
||||
if EMT.X1DELTA then
|
||||
local dPosX1 = EMT.L1 + EMT.X1DELTA
|
||||
sOut = 'G1 X' .. EmtLenToString( dPosX1, 3) .. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
elseif EMT.X2DELTA then
|
||||
local dPosX2 = EMT.L1 + EMT.X2DELTA
|
||||
sOut = 'G1 X' .. EmtLenToString( dPosX2, 3) .. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
else
|
||||
EmtSetLastError( 1213, "Part to machine without charriots")
|
||||
end
|
||||
else
|
||||
-- movimento di tutti gli assi assieme
|
||||
if EMT.X1DELTA then
|
||||
local dPosX1 = EMT.L1 + EMT.X1DELTA
|
||||
sOut = 'G1 X=' .. EmtLenToString( dPosX1, 3) .. ' Y=' .. EgtNumToString( EMT.L2, 3)..
|
||||
' A1='..EgtNumToString( EMT.R2, 3).. ' C1='..EgtNumToString( EMT.R1, 3).. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
elseif EMT.X2DELTA then
|
||||
local dPosX2 = EMT.L1 + EMT.X2DELTA
|
||||
sOut = 'G1 X' .. EmtLenToString( dPosX2, 3) .. ' Y=' .. EgtNumToString( EMT.L2, 3)..
|
||||
' A1='..EgtNumToString( EMT.R2, 3).. ' C1='..EgtNumToString( EMT.R1, 3).. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
else
|
||||
EmtSetLastError( 1213, "Part to machine without charriots")
|
||||
end
|
||||
|
||||
-- se ho lanciato split in modo asincrono, dopo POSIZ_YAC devo attendere
|
||||
if EMT.WAIT_SPLIT then
|
||||
MyEmtOutput( 'WAITP(X1)')
|
||||
EMT.WAIT_SPLIT = nil
|
||||
end
|
||||
end
|
||||
|
||||
MyEmtOutput( '_N'..sStep2..':STOPRE')
|
||||
end
|
||||
|
||||
|
||||
-- primo posizionamento testa rispetto a 0M
|
||||
EmtResetPrev()
|
||||
-- sega a catena da gestire
|
||||
@@ -681,99 +774,8 @@ function OnRapid()
|
||||
-- local dFeedY, dFeedA, dFeedC = CalcFeedYAC( EMT.L2opp - EMT.L2, EMT.R2pp - EMT.R2, EMT.R1pp - EMT.R1)
|
||||
-- sOut = '_POSIZ_YAC('..EgtNumToString( EMT.L2, 3)..','..EgtNumToString( EMT.R2, 3)..','..EgtNumToString( EMT.R1, 3)..','.. EgtNumToString( FmaxY, 0)..',,)'
|
||||
|
||||
|
||||
-- si ripete macro di carico con opzione di precarico eseguito
|
||||
if EMT.LOAD then
|
||||
MyEmtOutput( EMT.PRELOADCMD)
|
||||
EMT.PRELOADCMD = nil
|
||||
end
|
||||
|
||||
-- se si sono spostati i carrelli
|
||||
if bMoveChar then
|
||||
--MyEmtOutput( 'TRANS')
|
||||
local sOut = 'G1 Y=' .. EgtNumToString( EMT.L2, 3)..' A1='..EgtNumToString( EMT.R2, 3)..' C1='..EgtNumToString( EMT.R1, 3) .. ' F' .. EgtNumToString( FmaxY, 3)
|
||||
MyEmtOutput( sOut)
|
||||
end
|
||||
|
||||
|
||||
EMT.LOAD = false
|
||||
|
||||
-- se ho lanciato split in modo asincrono, dopo POSIZ_YAC devo attendere
|
||||
if EMT.WAIT_SPLIT then
|
||||
MyEmtOutput( 'WAITP(X1)')
|
||||
EMT.WAIT_SPLIT = nil
|
||||
end
|
||||
|
||||
-- se necessario, attesa fine movimenti carrelli e presa assi relativi
|
||||
if bMoveChar then
|
||||
MyEmtOutput( 'WAIT_CHAN(2)')
|
||||
EMT.CHAN2 = nil
|
||||
|
||||
if EMT.X1DELTA and EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X1,X2)')
|
||||
MyEmtOutput( 'STOPRE')
|
||||
MyEmtOutput( 'TRAILON(X2,X1)')
|
||||
EMT.TRAILON = true
|
||||
elseif EMT.X1DELTA then
|
||||
MyEmtOutput( 'GET(X1)')
|
||||
elseif EMT.X2DELTA then
|
||||
MyEmtOutput( 'GET(X2)')
|
||||
end
|
||||
end
|
||||
|
||||
-- se stato pinza attiva non coerente con master, si riscrivono gli assi
|
||||
if EMT.X1DELTA or EMT.X2DELTA then
|
||||
if EMT.X1DELTA and not EMT.X1MASTER then
|
||||
EMT.X1MASTER = true
|
||||
MyEmtOutput( 'GEOAX(1,X1,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
elseif EMT.X2DELTA and ( EMT.X1MASTER and not EMT.X1DELTA) then
|
||||
EMT.X1MASTER = false
|
||||
MyEmtOutput( 'GEOAX(1,X2,2,Y1,3,Z1)')
|
||||
MyEmtOutput( 'G90 G17')
|
||||
end
|
||||
end
|
||||
|
||||
-- dopo aver spostato i carrelli, lancio precarico
|
||||
-- se taglio di coda senza residuo da scaricare, emetto macro per accelerare il carico della barra successiva
|
||||
if EMT.MCHUSERNOTES and EMT.MCHUSERNOTES:find( 'Cut') and not EMT.PRELOAD then
|
||||
EMT.PRELOAD = true
|
||||
MyEmtOutput( '_POSIZ_T(4,,,,,,,,,)') -- Lancio macro per carico anticipato: i valori sono presi dal plc (passati dall'interfaccia)
|
||||
end
|
||||
|
||||
-- se si sono mossi i carrelli
|
||||
if bMoveChar then
|
||||
-- primo posizionamento carrello rispetto a 0M
|
||||
if EMT.X1DELTA then
|
||||
local dPosX1 = EMT.L1 + EMT.X1DELTA
|
||||
local sOut = 'G1 X' .. EmtLenToString( dPosX1, 3) .. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
elseif EMT.X2DELTA then
|
||||
local dPosX2 = EMT.L1 + EMT.X2DELTA
|
||||
local sOut = 'G1 X' .. EmtLenToString( dPosX2, 3) .. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
else
|
||||
EmtSetLastError( 1213, "Part to machine without charriots")
|
||||
end
|
||||
else
|
||||
-- MyEmtOutput( 'TRANS')
|
||||
-- assegnazione assi geometrici (GEOAX)
|
||||
-- primo posizionamento carrello rispetto a 0M
|
||||
if EMT.X1DELTA then
|
||||
local dPosX1 = EMT.L1 + EMT.X1DELTA
|
||||
local sOut = 'G1 X=' .. EmtLenToString( dPosX1, 3) .. ' Y=' .. EgtNumToString( EMT.L2, 3)..
|
||||
' A1='..EgtNumToString( EMT.R2, 3).. ' C1='..EgtNumToString( EMT.R1, 3).. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
elseif EMT.X2DELTA then
|
||||
local dPosX2 = EMT.L1 + EMT.X2DELTA
|
||||
local sOut = 'G1 X' .. EmtLenToString( dPosX2, 3) .. ' Y=' .. EgtNumToString( EMT.L2, 3)..
|
||||
' A1='..EgtNumToString( EMT.R2, 3).. ' C1='..EgtNumToString( EMT.R1, 3).. ' F' .. GetClampFeed( EMT.LENGTHBEAM)
|
||||
MyEmtOutput( sOut)
|
||||
else
|
||||
EmtSetLastError( 1213, "Part to machine without charriots")
|
||||
end
|
||||
end
|
||||
|
||||
-- se taglio di separazione prima di scarico a caduta, emissione stop tappeto scarico trucioli
|
||||
if EMT.PREFALLCUT then
|
||||
MyEmtOutput( ';M29')
|
||||
@@ -782,6 +784,7 @@ function OnRapid()
|
||||
EMT.REFLOC = 0
|
||||
EMT.MCHFIRST = false
|
||||
EMT.ZMAX = false
|
||||
EMT.TSELECT = false
|
||||
|
||||
-- se alto in Z (non serve l'avvicinamento finale)
|
||||
if EMT.FLAG == 2 then
|
||||
@@ -793,7 +796,6 @@ function OnRapid()
|
||||
else
|
||||
MyRestoreAxes()
|
||||
end
|
||||
|
||||
end
|
||||
-- se standard
|
||||
if EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '3.1e1_DEV3'
|
||||
PP_VER = '3.1e1_DEV4'
|
||||
MIN_MACH_VER = '3.1c1'
|
||||
|
||||
EgtOutLog ( '** Saomad-KAIROS '..PP_VER..' (MinMach '.. MIN_MACH_VER ..') **', 1)
|
||||
|
||||
Reference in New Issue
Block a user