5 Commits

Author SHA1 Message Date
andrea.villa 38bb400286 Modifiche ISO all'inizio lavorazione per gestione ripartenza 2026-05-15 08:18:28 +02:00
andrea.villa 39f1fee4cd In caso di ripartenza si aspettano 2 secondi per aspettare caricamento del file dei pinzaggi 2026-05-14 12:15:13 +02:00
andrea.villa 3dc2d709bc Corretta scrittura apeertura chiusura pinze 2026-05-14 09:48:41 +02:00
andrea.villa 779e049eca - Sistemati codici per ripartenze
- Aggiunti movimenti simulazione cambio utensile
2026-05-12 08:25:15 +02:00
andrea.villa 938c9fc536 - Scarico diviso in più chiamate per gestire ripartenza
- variabili OFS_T5_X1 diventano OFS_TS1_X1
2026-05-11 16:40:39 +02:00
3 changed files with 214 additions and 170 deletions
+189 -160
View File
@@ -591,82 +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')
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
@@ -678,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')
@@ -779,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
@@ -790,7 +796,6 @@ function OnRapid()
else
MyRestoreAxes()
end
end
-- se standard
if EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
@@ -1093,7 +1098,7 @@ function PrepareMoveChar( sCmd)
if Cmd[2] == '0' and EMT.X1CLAMP then
EMT.X1CLAMP = nil
table.insert( CLAMP_POS, 'GRIPPER("AP1",,)')
elseif not EMT.X1CLAMP and Cmd[2] ~= '0' then
elseif ( not EMT.X1CLAMP or not EMT.X1DELTA) and Cmd[2] ~= '0' then
EMT.X1CLAMP = true
local sVertClamp = EgtIf( Cmd[2] == '2', '1', '0')
table.insert( CLAMP_POS, 'GRIPPER("CH1",'.. sVertClamp ..',2.5)')
@@ -1102,7 +1107,7 @@ function PrepareMoveChar( sCmd)
if Cmd[2] == '0' and EMT.X2CLAMP then
EMT.X2CLAMP = nil
table.insert( CLAMP_POS, 'GRIPPER("AP2",,)')
elseif not EMT.X2CLAMP and Cmd[2] ~= '0' then
elseif ( not EMT.X2CLAMP or not EMT.X2DELTA) and Cmd[2] ~= '0' then
EMT.X2CLAMP = true
local sVertClamp = EgtIf( Cmd[2] == '2', '1', '0')
table.insert( CLAMP_POS, 'GRIPPER("CH2",'.. sVertClamp ..',2.5)')
@@ -1337,12 +1342,28 @@ function PrepareUnload( sCmd)
local sStep = EgtNumToString( EMT.NSTEP, 0)
local sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
local sX2Pos = Cmd[3]
sOut = string.format( 'G1 X=%s F=%d', sX2Pos, EMT.FMAXPINZE)
sOut = string.format( 'POS[X2]=%s FA[X2]=%d', sX2Pos, EMT.FMAXPINZE)
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,2,,,,)' -- attiva spintore scarico pezzo restanto su processo 1
sOut = '_POSIZ_T(5,,,,,3,,,,)\n' -- discesa blocco pezzo
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
EMT.NSTEP = EMT.NSTEP + 10
sStep = EgtNumToString( EMT.NSTEP, 0)
sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,4,,,,)\n' -- pistone scarico avanti per spingere pezzo
table.insert( EMT.AUXSTR, sOut)
EMT.NSTEP = EMT.NSTEP + 10
sStep = EgtNumToString( EMT.NSTEP, 0)
sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,5,,,,)\n' -- pistone scarico indietro
table.insert( EMT.AUXSTR, sOut)
end
elseif Cmd[1] == '2' then
@@ -1350,10 +1371,10 @@ function PrepareUnload( sCmd)
local sStep = EgtNumToString( EMT.NSTEP, 0)
local sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
local sX2Pos = Cmd[5]
sOut = string.format( 'G1 X=%s F=%d', sX2Pos, EMT.FMAXPINZE)
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
local sX2Pos = Cmd[5]
sOut = string.format( 'POS[X2]=%s FA[X2]=%d\n', sX2Pos, EMT.FMAXPINZE)
table.insert( EMT.AUXSTR, sOut)
elseif Cmd[1] == '3' then
-- non gestito
@@ -1364,9 +1385,17 @@ function PrepareUnload( sCmd)
local sStep = EgtNumToString( EMT.NSTEP, 0)
local sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,1,,,,)' -- apre pinza 2 restando su processo 1
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
sOut = '_POSIZ_T(5,,,,,1,,,,)\n' -- apre pinza 2
table.insert( EMT.AUXSTR, sOut)
EMT.NSTEP = EMT.NSTEP + 10
sStep = EgtNumToString( EMT.NSTEP, 0)
sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE'
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,2,,,,)\n' -- solleva il blocca-pezzo
table.insert( EMT.AUXSTR, sOut)
elseif Cmd[1] == '21' then
-- non interessa
@@ -1685,13 +1714,13 @@ function CalcInterpPlane()
local dAngO2 = EmtGetAngO2( EMT.IPLGLFR:getVersZ(), EMT.IPLGLFR:getVersX(), dAngV, dAngO)
local sXout, sYout, sZout
if EMT.X1DELTA then
sXout = ' X='..EmtLenToString( xS + EMT.X1DELTA)..'+OFS_T5_X1[0]'
sYout = ' Y=OFS_T5_X1[1]'
sZout = ' Z=OFS_T5_X1[2]'
sXout = ' X='..EmtLenToString( xS + EMT.X1DELTA)..'+OFS_TS1_X1[0]'
sYout = ' Y=OFS_TS1_X1[1]'
sZout = ' Z=OFS_TS1_X1[2]'
elseif EMT.X2DELTA then
sXout = ' X='..EmtLenToString( xS + EMT.X2DELTA)..'+OFS_T5_X2[0]'
sYout = ' Y=OFS_T5_X2[1]'
sZout = ' Z=OFS_T5_X2[2]'
sXout = ' X='..EmtLenToString( xS + EMT.X2DELTA)..'+OFS_TS1_X2[0]'
sYout = ' Y=OFS_TS1_X2[1]'
sZout = ' Z=OFS_TS1_X2[2]'
else
EmtSetLastError( 1214, "Part to machine without charriots")
end
@@ -1771,7 +1800,7 @@ function CreateClampingFile()
local nReposNumber = i * 100
local nReposNumber2 = (i + 1) * 100
nfile:write( '\nIF ((_STEP3>=' .. EgtNumToString( nReposNumber) ..') AND (_STEP3<'.. EgtNumToString( nReposNumber2) .. '))\n')
nfile:write( ' IF _STEP3<>' .. EgtNumToString( nReposNumber) ..' GOTOF JUMP3\n')
nfile:write( ' IF _STEP3<>' .. EgtNumToString( nReposNumber) ..'\n G4F2\n GOTOF JUMP3\n ENDIF\n')
local nInternalStep = 0
for j = 1, #ALL_CLAMP_POS[i] do
-- comando speciale per aggiungere etichetta per ripartenza
+4 -2
View File
@@ -9,7 +9,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1d1_DEV9'
PP_VER = '3.1e1_DEV4'
MIN_MACH_VER = '3.1c1'
EgtOutLog ( '** Saomad-KAIROS '..PP_VER..' (MinMach '.. MIN_MACH_VER ..') **', 1)
@@ -19,7 +19,7 @@ NumericalControl = 'SIEMENS'
ChainSaw = false
MinY = -823
MaxY = 520
ParkY = 400
ParkY = -125
FmaxY = 45000
MinZ = -298
MaxZ = 915
@@ -30,6 +30,8 @@ MaxA = 120
MinSawA = -101
MaxSawA = 101
ParkA = 0
TakePosTC_R = -90
TakePosTC_L = 90
FmaxA = 10440
MinC = -240
MaxC = 240
+21 -8
View File
@@ -504,6 +504,10 @@ function OnSimulToolSelect( dPosCS)
EMT.TCPOS_1 = EMT.TCPOS
-- lo nascondo sul portautensili
ShowToolInTcPos( EMT.TCPOS, false)
-- movimento di uscita dal porta utensile
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
SimulMoveAxes( 'Y', ParkY, MCH_SIM_STEP.RAPID, 'A', ParkA, MCH_SIM_STEP.RAPROT, 'C', ParkC, MCH_SIM_STEP.RAPROT)
end
end
---------------------------------------------------------------------
@@ -522,30 +526,39 @@ function OnSimulToolDeselect()
else
SimulMoveAxes( 'A', ParkA, MCH_SIM_STEP.COLLROT, 'C', GetChainSawCHomeFromVirtualAxis( dPosCS), MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Y', ParkY, MCH_SIM_STEP.RAPID)
elseif EMT.HEAD == 'H2' then
SimulMoveAxes( 'A', TakePosTC_R, MCH_SIM_STEP.COLLROT, 'C', ParkC, MCH_SIM_STEP.COLLROT)
elseif EMT.HEAD == 'H1' then
SimulMoveAxes( 'A', TakePosTC_L, MCH_SIM_STEP.COLLROT, 'C', ParkC, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Y', MinY, MCH_SIM_STEP.RAPID)
-- breve pausa
EgtPause( 100)
-- nascondo utensile su testa e lo visualizzo su TcPos
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- movimento per carico utensile
SimulMoveAxes( 'A', ParkA, MCH_SIM_STEP.RAPROT, 'C', ParkC, MCH_SIM_STEP.RAPROT)
--SimulMoveAxes( 'Y', ParkY, MCH_SIM_STEP.RAPID, 'A', ParkA, MCH_SIM_STEP.RAPROT, 'C', ParkC, MCH_SIM_STEP.RAPROT)
EgtOutText( '')
-- deposito utensile
else
if EMT.NEXTTOOL ~= EMT.TOOL_1 then
EgtOutText( 'Tool change in progress...')
-- simulo movimento
SimulMoveAxes( 'A', ParkA, MCH_SIM_STEP.COLLROT, 'C', ParkC, MCH_SIM_STEP.COLLROT)
SimulMoveAxis( 'Y', ParkY, MCH_SIM_STEP.RAPID)
if EMT.HEAD == 'H2' then
SimulMoveAxes( 'A', TakePosTC_R, MCH_SIM_STEP.COLLROT, 'C', ParkC, MCH_SIM_STEP.COLLROT)
elseif EMT.HEAD == 'H1' then
SimulMoveAxes( 'A', TakePosTC_L, MCH_SIM_STEP.COLLROT, 'C', ParkC, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxis( 'Y', MinY, MCH_SIM_STEP.RAPID)
-- breve pausa
EgtPause( 100)
-- nascondo utensile su testa e lo visualizzo su TcPos
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
ShowToolInTcPos( EMT.TCPOS_1, true)
-- nascondo l'utensile corrente
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
-- eseguo movimento opportuno
SimulMoveAxes( 'A', ParkA, MCH_SIM_STEP.RAPROT, 'C', ParkC, MCH_SIM_STEP.RAPROT)
EgtOutText( '')
-- eseguo movimento opportuno
--SimulMoveAxes( 'A', ParkA, MCH_SIM_STEP.RAPROT, 'C', ParkC, MCH_SIM_STEP.RAPROT)
else
EMT.TOOL_1 = nil
EMT.TCPOS_1 = nil