18 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
andrea.villa 24b5d0190b Aggiunta attesa canale 2 in caso di riposizionamento dei carrelli 2026-04-30 13:10:32 +02:00
andrea.villa 4454073970 Modificata posizione di scarico 2026-04-30 08:33:11 +02:00
andrea.villa e729a12c2d Migliorata emissione TRANS e STOPRE 2026-04-30 08:21:17 +02:00
andrea.villa 169476cb43 - Se c'è un restante, l'ultimo pezzo scaricato con POSIZ_T(6) su processo 2
- Il restante scaricato con macro POSIZ_T(5) su processo 1 che permette di lanciare il precarico su processo 2
2026-04-29 18:11:59 +02:00
andrea.villa cc817a8d39 Merge remote-tracking branch 'origin/NewLink' into develop 2026-04-29 11:11:25 +02:00
andrea.villa 54f5c7e488 Commentata chiamata alla funzionalità per attivare i supporti perchè questa macchina ne è sprovvista 2026-04-29 11:06:29 +02:00
andrea.villa 62d5cefb35 Corretta scrittura step per ripartenza 2026-04-28 17:10:17 +02:00
andrea.villa 913be3f3e7 - Se unload , rimossa risalita a ZMAX
- GEOAX sempre riscritto se stato non coerente
2026-04-28 15:54:31 +02:00
andrea.villa 898380b4ba - Aggiunta nuova variabile PLC
- Selezione X2 dopo uno split
2026-04-28 14:53:56 +02:00
andrea.villa ec79024eb3 Anticipo movimento di carico ( che viene messo su canale 2) prima del movimento testa 2026-04-28 13:38:15 +02:00
andrea.villa f9fb148fd8 Messe funzioni vecchie per lavorazioni in doppio 2026-04-27 17:28:58 +02:00
andrea.villa 6780390b28 Prima versione generazione per rimanere basso su pezzo in caso non ci sia cambio carrelli 2026-04-27 16:56:58 +02:00
andrea.villa 482e6fb281 Per info ID pezzo e barra si cerca prima sul MachGroup. DA VERIFICARE 2026-04-23 17:00:30 +02:00
8 changed files with 430 additions and 309 deletions
+1 -1
View File
@@ -60,7 +60,7 @@ local BeamData = {
ADVANCE_TAIL_CUT = true, -- per spostare prima del taglio di separazione il taglio di coda su pezzi corti con probabile caduta
ADVANCE_TAIL_OFFS = 5, -- accorciamento taglio di coda avanzato (minimo 1)
STRATEGIES_CONFIG_FILE = 'Std2.json',
FASTCLAMPING = true
FASTCLAMPING = false
}
-- Aggiornamento con dati da B&W
+1 -1
View File
@@ -38,7 +38,7 @@ local BeamData = {
VICE_MINH = 110, -- altezza minima della morsa
VICE_MAXH = 370, -- altezza massima zona pinzaggio orizzontale
USER_HOLE_DIAM = 0, -- diametro foro per L20
FASTCLAMPING = true
FASTCLAMPING = false
}
-- costanti riportate da mlde non necessarie per automatismo (sostituire con GetParameters o simile)
+1 -1
View File
@@ -16,7 +16,7 @@ local Offsets = {
MAX_X2=-62,
PARK_X2=-500,
BEAM_LOAD=1800.0,
BEAM_UNLOAD=-2060,
BEAM_UNLOAD=-2150,
TURN_OFFS=0,
MILL_PIVOT=-211.00,
TAB_OFFSET_Y=0,
+369 -290
View File
@@ -99,7 +99,6 @@ function OnToolData()
local tToolType = { [256] = 'DRILL', [257] = 'DRILL_L', [512] = 'SAW', [513] = 'SAW_F', [1024] = 'MILL', [1025] = 'MILL_NT',
[1026] = 'POLISHING', [2048] = 'CHAINSAW', [4096] = 'CHISEL'}
-- emissione dati utensile
--local sOut = ';'..EMT.TCPOS..' L='..EmtLenToString( EMT.TLEN, 3)..' D='..EmtLenToString( EMT.TDIAM, 3)..' A='..EgtIf( EMT.TUSED, '1', '0')..' '..( tToolType[EMT.TTYPE] or 'NONE')
local sOut = ';'..EMT.TCPOS..' L='..EmtLenToString( EMT.TLEN, 3)..' D='..EmtLenToString( EMT.TDIAM, 3)..' A='..EgtIf( EMT.TUSED, '1', '0')..' '..EMT.TOOL
MyEmtOutput( sOut)
end
@@ -174,7 +173,7 @@ function OnDispositionEnd()
end
-- Inizio produzione trave
if IdTrave >= 0 then
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local BtlInfoId = EgtGetCurrMachGroup() or EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL
EMT.PRODID = EgtGetInfo( BtlInfoId, 'PRODID', 'i') or 0
EMT.PATTID = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 0
EMT.CUTID = EgtGetInfo( EMT.IDT, 'CUTID', 'i') or 0
@@ -241,10 +240,6 @@ function OnDispositionEnd()
MyEmtOutput( ';PART UNLOAD')
MyEmtOutput( 'STOPRE')
MyEmtOutput( 'TRANS')
if EMT.X1MASTER then
MyEmtOutput( 'GEOAX(1,X2,2,Y1,3,Z1)')
EMT.X1MASTER = false
end
end
for i = 1, #EMT.AUXSTR do
MyEmtOutput( EMT.AUXSTR[i])
@@ -363,45 +358,44 @@ function OnMachiningEnd()
--for i = 1, #EMT.AUXCMD do
-- MyEmtOutput( '( ' .. EMT.AUXCMD[i] .. ' )')
--end
-- sincronizzazione e reset piano
MyEmtOutput( 'STOPRE')
MyEmtOutput( 'TRANS')
EMT.AUXCMD = {}
if #EMT.AUXSTR > 0 then
if EMT.AUXTYPE == 'S' then
-- EmitSpeedOff()
MyEmtOutput( ';PART SPLIT')
elseif EMT.AUXTYPE == 'U' then
if not EMT.ZMAX then
EmitZmax()
EMT.ZMAX = true
end
--if not EMT.ZMAX then
-- EmitZmax()
-- EMT.ZMAX = true
--end
if IsLastMachining( EMT.MCHID) then
-- EmitSpeedOff()
end
MyEmtOutput( ';PART UNLOAD')
MyEmtOutput( 'STOPRE')
MyEmtOutput( 'TRANS')
if EMT.X1MASTER then
MyEmtOutput( 'GEOAX(1,X2,2,Y1,3,Z1)')
EMT.X1MASTER = false
end
elseif EMT.AUXTYPE == 'P' then
if EMT.PREROT then
if not EMT.ZMAX then
EmitZmax()
EMT.ZMAX = true
end
--if not EMT.ZMAX then
-- EmitZmax()
-- EMT.ZMAX = true
--end
MyEmtOutput( ';PART ROTATION')
elseif EMT.FALL then
if not EMT.ZMAX then
EmitZmax()
EMT.ZMAX = true
end
--if not EMT.ZMAX then
-- EmitZmax()
-- EMT.ZMAX = true
--end
MyEmtOutput( ';FALL')
else
if not EMT.ZMAX then
EmitZmax()
EMT.ZMAX = true
end
--if not EMT.ZMAX then
-- EmitZmax()
-- EMT.ZMAX = true
--end
MyEmtOutput( ';SPLIT 2')
end
end
@@ -550,13 +544,6 @@ function OnRapid()
MyBackupAxes()
-- se primo movimento della lavorazione, gestione speciale
if EMT.MCHFIRST and not EMT.OPEISDISP then
-- decido se muovere prima testa o carrelli (standard prima testa)
local bHeadFirst = true
local sLateG101
if not ( EMT.LOAD or EMT.RELOAD) and not EMT.ZMAX then
local DeltaT = EMT.L1 - EMT.TLAST
if ( DeltaT < -GEO.EPS_SMALL and EMT.X2DELTA) or ( DeltaT > GEO.EPS_SMALL and EMT.X1DELTA) then bHeadFirst = false end
end
-- sistemo movimenti
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
@@ -592,97 +579,71 @@ function OnRapid()
end
EMT.AUXSTR = {}
-- supporti in posizione intermedia
local sOut = 'SUPPORT(1,1)'
MyEmtOutput( sOut)
-- local sOut = 'SUPPORT(1,1)'
-- MyEmtOutput( sOut)
-- prima lavorazione
sOut = EMT.MCHNAME..'/'..EMT.TOOL
MyEmtOutput( '; *** ' .. sOut .. ' ***')
local sOut = EMT.MCHNAME..'/'..EMT.TOOL
MyEmtOutput( '\n; *** ' .. sOut .. ' ***')
-- altri casi
else
if not EMT.RELOAD and not EMT.ZMAX and #EMT.AUXSTR > 0 then
EmitZmax()
EMT.ZMAX = true
--EmitZmax()
--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
local sOut = EMT.MCHNAME..'/'..EMT.TOOL
MyEmtOutput( '\n; *** ' .. sOut .. ' ***')
-- se ci sono movimenti carrelli
EMT.AUXCMD = {}
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
local sOut = EMT.MCHNAME..'/'..EMT.TOOL
MyEmtOutput( '; *** ' .. sOut .. ' ***')
-- movimento carrelli
EMT.AUXCMD = {}
for i = 1, #EMT.AUXSTR do
MyEmtOutput( EMT.AUXSTR[i])
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)
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
-- eventuale avvio mandrino (se non già avviato)
EmitSpeedOn( EMT.S)
-- primo posizionamento testa rispetto a 0M
EmtResetPrev()
local sOut
if EMT.ZMAX then
sOut = 'SUPA G0 D0 Z'..EgtNumToString( ParkZ, 3)
else
-- sOut = 'SUPA G0 D0' .. EmtGetAxis( 'L3')
end
MyEmtOutput( sOut)
-- sega a catena da gestire
if EMT.HEAD == 'H3' then
MyEmtOutput( '!!! Chainsaw start movements to be calculated !!!')
EgtOutLog( 'ERROR : CHAINSAW START MOVEMENTS TO BE CALCULATED !!!')
end
-- movimento YAC con interpolazione approssimata tramite F opportune per ogni asse
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)..',,)'
sOut = 'TRANS'
MyEmtOutput( sOut)
sOut = 'G1 Y=' .. EgtNumToString( EMT.L2, 3)..' A1='..EgtNumToString( EMT.R2, 3)..' C1='..EgtNumToString( EMT.R1, 3) .. ' F' .. EgtNumToString( FmaxY, 3)
end
-- 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)
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)
-- si ripete macro di carico con opzione di precarico eseguito
if EMT.LOAD then
@@ -690,68 +651,131 @@ function OnRapid()
EMT.PRELOADCMD = nil
end
EMT.LOAD = false
-- se ho lanciato split in modo asincrono, dopo POSIZ_YAC devo attendere
if EMT.WAIT_SPLIT then
sOut = 'WAITP(X1)'
MyEmtOutput( sOut)
EMT.WAIT_SPLIT = nil
end
-- se necessario, attesa fine movimenti carrelli e presa assi relativi
if bMoveChar then
sOut = 'WAIT_CHAN(2)'
MyEmtOutput( sOut)
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
-- assegnazione assi geometrici (GEOAX)
MyEmtOutput( 'TRANS')
if EMT.X1DELTA then
sOut = 'GEOAX(1,X1,2,Y1,3,Z1)'
EMT.X1MASTER = true
else
sOut = 'GEOAX(1,X2,2,Y1,3,Z1)'
EMT.X1MASTER = false
end
sOut = 'G1 Y=' .. EgtNumToString( EMT.L2, 3)..' A1='..EgtNumToString( EMT.R2, 3)..' C1='..EgtNumToString( EMT.R1, 3) .. ' F' .. EgtNumToString( FmaxY, 3)
MyEmtOutput( sOut)
-- 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
sOut = '_POSIZ_T(4,,,,,,,,,)' -- Lancio macro per carico anticipato: i valori sono presi dal plc (passati dall'interfaccia)
MyEmtOutput( sOut)
if EMT.LOAD then
MyEmtOutput( 'WAIT_CHAN(2)')
EMT.CHAN2 = nil
end
MyEmtOutput( 'G90 G17')
-- 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)
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
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")
MyEmtOutput( 'GET(X2)')
end
if EMT.ZMAX and EMT.L3 < ParkZ - 10 then
sOut = 'SUPA G0 D0' .. EmtGetAxis( 'L3')
MyEmtOutput( sOut)
-- 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
if EMT.HEAD == 'H3' then
MyEmtOutput( '!!! Chainsaw start movements to be calculated !!!')
EgtOutLog( 'ERROR : CHAINSAW START MOVEMENTS TO BE CALCULATED !!!')
end
-- movimento YAC con interpolazione approssimata tramite F opportune per ogni asse
-- 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)..',,)'
EMT.LOAD = false
-- se taglio di separazione prima di scarico a caduta, emissione stop tappeto scarico trucioli
if EMT.PREFALLCUT then
MyEmtOutput( ';M29')
@@ -760,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
@@ -771,7 +796,6 @@ function OnRapid()
else
MyRestoreAxes()
end
end
-- se standard
if EMT.FLAG == 0 or EMT.FLAG == 1 or EMT.FLAG == 2 then
@@ -795,7 +819,7 @@ function OnRapid()
EMT.IPLGL = false
MyAdjustLinearAxes()
EmtAdjustRotaryAxes()
EmitZmax()
EmitZmax( EMT.L3)
EMT.ZMAX = true
-- se altrimenti movimento in Home
elseif EMT.FLAG == 4 then
@@ -1074,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)')
@@ -1083,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)')
@@ -1101,130 +1125,161 @@ function PrepareMoveChar( sCmd)
EMT.X1DELTA = nil
EMT.X2DELTA = dX2Delta
end
table.insert( ALL_CLAMP_POS, CLAMP_POS)
CLAMP_POS = {}
local nFunz = 77
local nVertClamp = 0
local dPress = 2.5
local dFeed = GetClampFeed( EMT.LENGTHPART)
local dAcc = 4
local nOpt = #ALL_CLAMP_POS * 100
local sOut = string.format( '_POSIZ_T(%d,,,,,%d,,,,,,)', nFunz, nOpt)
table.insert( EMT.AUXSTR, sOut)
-- se ci sono movimenti, si scrive macro
if #CLAMP_POS > 0 then
table.insert( ALL_CLAMP_POS, CLAMP_POS)
CLAMP_POS = {}
local nFunz = 77
local nVertClamp = 0
local dPress = 2.5
local dFeed = GetClampFeed( EMT.LENGTHPART)
local dAcc = 4
local nOpt = #ALL_CLAMP_POS * 100
local sOut = string.format( '_POSIZ_T(%d,,,,,%d,,,,,,)', nFunz, nOpt)
table.insert( EMT.AUXSTR, sOut)
end
end
end
---------------------------------------------------------------------
function PrepareResidue( sCmd)
local Cmd = EgtSplitString( sCmd)
if Cmd[1] == '0' then
-- se non è scarico
if Cmd[2] ~= 'Unloading' then
-- se inizio
if EMT.AUXIND <= 2 then
-- reset stato
EMT.MCIND = 0
EMT.X1STAT = 0
EMT.X2STAT = 0
EMT.MCX1 = {}
EMT.MCX2 = {}
-- se terminato posizionamenti e si deve scaricare
if EMT.UNL then
if Cmd[1] == '0' then
elseif Cmd[1] == '1' then
if Cmd[2] ~= 'Z' then
EMT.NSTEP = EMT.NSTEP + 10
local sStep = EgtNumToString( EMT.NSTEP, 0)
local sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
local sX2Pos = Cmd[3]
sOut = string.format( 'G1 X=%s F=%d', sX2Pos, EMT.FMAXPINZE)
table.insert( EMT.AUXSTR, sOut)
sOut = '_POSIZ_T(5,,,,,2,,,,)' -- attiva spintore scarico pezzo restanto su processo 1
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
table.insert( EMT.AUXSTR, sOut)
end
else
EMT.UNL = true
end
elseif Cmd[1] == '1' then
if Cmd[2] ~= 'Z' then
EMT.MCIND = EMT.MCIND + 1
if Cmd[2] == 'X1' then
EMT.MCX1[EMT.MCIND] = tonumber( Cmd[3])
EMT.MCX2[EMT.MCIND] = 0
elseif Cmd[2] == 'X2' then
EMT.MCX1[EMT.MCIND] = 0
EMT.MCX2[EMT.MCIND] = tonumber( Cmd[3])
end
end
elseif Cmd[1] == '2' then
EMT.MCIND = EMT.MCIND + 1
for i = 2, 4, 2 do
if Cmd[i] == 'X1' then
EMT.MCX1[EMT.MCIND] = tonumber( Cmd[i+1])
elseif Cmd[i] == 'X2' then
EMT.MCX2[EMT.MCIND] = tonumber( Cmd[i+1])
end
end
if not EMT.MCX1[EMT.MCIND] then EMT.MCX1[EMT.MCIND] = 0 end
if not EMT.MCX2[EMT.MCIND] then EMT.MCX2[EMT.MCIND] = 0 end
elseif Cmd[1] == '3' then
EMT.MCIND = EMT.MCIND + 1
for i = 2, 6, 2 do
if Cmd[i] == 'X1' then
EMT.MCX1[EMT.MCIND] = tonumber( Cmd[i+1])
elseif Cmd[i] == 'X2' then
EMT.MCX2[EMT.MCIND] = tonumber( Cmd[i+1])
end
end
elseif Cmd[1] == '11' then
EMT.X1STAT = tonumber( Cmd[2])
if Cmd[2] == 0 then
EMT.X1CLAMP = nil
else
EMT.X1CLAMP = true
end
elseif Cmd[1] == '12' then
if Cmd[2] == 0 then
EMT.X2CLAMP = nil
else
EMT.X2CLAMP = true
end
EMT.X2STAT = tonumber( Cmd[2])
if EMT.UNL and EMT.X2STAT == 0 then
-- local sWait = 'WAIT_CHAN(2)'
-- table.insert( EMT.AUXSTR, sWait)
local sSync = 'STOPRE'
table.insert( EMT.AUXSTR, sSync)
local nFunz = 6
local nVertClamp = 0
local dPress = 2.5
local dFeed = GetClampFeed( EMT.LENGTHPART)
local dAcc = 4
local nOpt = 0
local sRef1 = EMT.MCX2[#EMT.MCX2]
local sRef2 = EmtLenToString( ParkX2 - ( EMT.LENGTHBEAM - EMT.X2DELTA), 3)
local sOut = string.format( '_POSIZ_T(%d,%d,%.1f,%.1f,%.1f,%d,%s,%s,,)', nFunz, nVertClamp, dPress, dFeed, dAcc, nOpt, sRef1, sRef2)
elseif Cmd[1] == '2' then
EMT.NSTEP = EMT.NSTEP + 10
local sStep = EgtNumToString( EMT.NSTEP, 0)
local sOut = '_STEP='..sStep
table.insert( EMT.AUXSTR, sOut)
end
elseif Cmd[1] == '21' then
local dX1Delta = tonumber( Cmd[2])
local dX2Delta = tonumber( Cmd[3])
if dX1Delta > 0 and dX2Delta > 0 then
EMT.X1DELTA = dX1Delta
EMT.X2DELTA = dX2Delta
elseif dX1Delta > 0 then
EMT.X1DELTA = dX1Delta
EMT.X2DELTA = nil
elseif dX2Delta > 0 then
EMT.X1DELTA = nil
EMT.X2DELTA = dX2Delta
end
if EMT.AUXIND > 1 then
local sInfo = string.format( ';X1->X2 D2=%.1f', EMT.LENGTHBEAM - EMT.X2DELTA)
table.insert( EMT.AUXSTR, sInfo)
local sWait = 'WAIT_CHAN(2)'
table.insert( EMT.AUXSTR, sWait)
local sSync = 'STOPRE'
table.insert( EMT.AUXSTR, sSync)
local nFunz = 31
local nVertClamp = 0
local dPress = 2.5
local dFeed = GetClampFeed( EMT.LENGTHBEAM)
local dAcc = 4
local nOpt = EgtIf( EMT.MCIND >= 3, 2, 1)
local sRef1 = EmtLenToString( EMT.MCX1[1], 3)
local sRef2 = EmtLenToString( EMT.MCX2[1], 3)
local sRef3 = EmtLenToString( EMT.MCX1[2], 3)
local sRef4 = EmtLenToString( EgtIf( EMT.MCX2[2] == 0, EMT.MCX2[1], EMT.MCX2[2]), 3)
local sOut = string.format( '_POSIZ_T(%d,%d,%.1f,%.1f,%.1f,%d,%s,%s,%s,%s)', nFunz, nVertClamp, dPress, dFeed, dAcc, nOpt, sRef1, sRef2, sRef3, sRef4)
local sX2Pos = Cmd[5]
sOut = string.format( 'G1 X=%s F=%d', sX2Pos, EMT.FMAXPINZE)
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
table.insert( EMT.AUXSTR, sOut)
elseif Cmd[1] == '3' then
-- non gestito
elseif Cmd[1] == '11' then
-- non gestito
elseif Cmd[1] == '12' then
EMT.NSTEP = EMT.NSTEP + 10
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
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
table.insert( EMT.AUXSTR, sOut)
elseif Cmd[1] == '21' then
-- non interessa
end
else
if Cmd[1] == '0' then
-- se è scarico
if Cmd[2] == 'Unloading' then
EMT.UNL = true
-- Lancio macro per carico anticipato: i valori sono presi dal plc (passati dall'interfaccia)
local sOut = '_POSIZ_T(4,,,,,,,,,)'
table.insert( EMT.AUXSTR, sOut)
end
elseif Cmd[1] == '1' then
if Cmd[2] ~= 'Z' then
local dFeed1 = EgtIf( EMT.X1CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dFeed2 = EgtIf( EMT.X2CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dX1Pos = GetValInString( sCmd, 'X1')
local dX2Pos = GetValInString( sCmd, 'X2')
table.insert( CLAMP_POS, '###_ADD_STEP_###')
if dX1Pos and dX2Pos then
table.insert( CLAMP_POS, string.format( 'POS[X1]=%.3f POS[X2]=%.3f FA[X1]=%d FA[X2]=%d', dX1Pos, dX2Pos, dFeed1, dFeed2))
elseif dX1Pos then
table.insert( CLAMP_POS, string.format( 'G1 X1=%.3f F=%d', dX1Pos, dFeed1))
elseif dX2Pos then
table.insert( CLAMP_POS, string.format( 'G1 X2=%.3f F=%d', dX2Pos, dFeed2))
end
end
elseif Cmd[1] == '2' then
local dFeed1 = EgtIf( EMT.X1CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dFeed2 = EgtIf( EMT.X2CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dX1Pos = GetValInString( sCmd, 'X1')
local dX2Pos = GetValInString( sCmd, 'X2')
table.insert( CLAMP_POS, '###_ADD_STEP_###')
if dX1Pos and dX2Pos then
table.insert( CLAMP_POS, string.format( 'POS[X1]=%.3f POS[X2]=%.3f FA[X1]=%d FA[X2]=%d', dX1Pos, dX2Pos, dFeed1, dFeed2))
elseif dX1Pos then
table.insert( CLAMP_POS, string.format( 'G1 X1=%.3f F=%d', dX1Pos, dFeed1))
elseif dX2Pos then
table.insert( CLAMP_POS, string.format( 'G1 X2=%.3f F=%d', dX2Pos, dFeed2))
end
elseif Cmd[1] == '3' then
local dFeed1 = EgtIf( EMT.X1CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dFeed2 = EgtIf( EMT.X2CLAMP, GetClampFeed( EMT.LENGTHPART), EMT.FMAXPINZE)
local dX1Pos = GetValInString( sCmd, 'X1')
local dX2Pos = GetValInString( sCmd, 'X2')
table.insert( CLAMP_POS, '###_ADD_STEP_###')
table.insert( CLAMP_POS, string.format( 'POS[X1]=%.3f POS[X2]=%.3f FA[X1]=%d FA[X2]=%d', dX1Pos, dX2Pos, dFeed1, dFeed2))
elseif Cmd[1] == '11' then
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
EMT.X1CLAMP = true
local sVertClamp = EgtIf( Cmd[2] == '2', '1', '0')
table.insert( CLAMP_POS, 'GRIPPER("CH1",'.. sVertClamp ..',2.5)')
end
elseif Cmd[1] == '12' then
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
EMT.X2CLAMP = true
local sVertClamp = EgtIf( Cmd[2] == '2', '1', '0')
table.insert( CLAMP_POS, 'GRIPPER("CH2",'.. sVertClamp ..',2.5)')
end
elseif Cmd[1] == '21' then
local dX1Delta = tonumber( Cmd[2])
local dX2Delta = tonumber( Cmd[3])
if dX1Delta > 0 and dX2Delta > 0 then
EMT.X1DELTA = dX1Delta
EMT.X2DELTA = dX2Delta
elseif dX1Delta > 0 then
EMT.X1DELTA = dX1Delta
EMT.X2DELTA = nil
elseif dX2Delta > 0 then
EMT.X1DELTA = nil
EMT.X2DELTA = dX2Delta
end
-- se ci sono movimenti, si scrive macro
if #CLAMP_POS > 0 then
table.insert( ALL_CLAMP_POS, CLAMP_POS)
CLAMP_POS = {}
EMT.NSTEP = EMT.NSTEP + 10
local sStep = EgtNumToString( EMT.NSTEP, 0)
table.insert( EMT.AUXSTR, '_STEP='..sStep)
local nFunz = 77
local nVertClamp = 0
local dPress = 2.5
local dFeed = GetClampFeed( EMT.LENGTHPART)
local dAcc = 4
local nOpt = #ALL_CLAMP_POS * 100
local sOut = string.format( '_POSIZ_T(%d,,,,,%d,,,,,,)', nFunz, nOpt)
table.insert( EMT.AUXSTR, sOut)
sOut = '_N'..sStep..':STOPRE\n'
table.insert( EMT.AUXSTR, sOut)
end
end
end
end
@@ -1287,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
@@ -1300,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
@@ -1314,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
@@ -1635,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
@@ -1670,8 +1749,8 @@ function VerifyEmitRotation()
end
---------------------------------------------------------------------
function EmitZmax()
local sOut = 'SUPA G0 D0 Z'..EgtNumToString( ParkZ, 3)
function EmitZmax( dPosZ)
local sOut = 'SUPA G0 D0 Z'..EgtNumToString( dPosZ, 3)
MyEmtOutput( sOut)
end
@@ -1721,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
+11 -2
View File
@@ -3,8 +3,8 @@
Material=Beam
NCType=5 ; 1=Tpa, 2=Num Flexium, 3=Num Axium APServer, 4=Num Axium PCToolkit, 5=Siemens_Sharp7
Flow=2
IsoFileDir=\\192.168.214.253\iso
Ip=192.168.214.1
IsoFileDir=\\192.168.0.253\iso
Ip=192.168.0.1
Rack=0
Slot=1
Debug=2
@@ -47,6 +47,15 @@ Debug=2
29=PLC_Messages5,302:26.0:2,c,plc
30=PLC_Messages6,302:28.0:2,c,plc
31=W_Carico,301:8.0:2,c,plc
32=NextPartL,301:10.0:2,c,plc
33=NextPartW,301:12.0:2,c,plc
34=NextPartH,301:14.0:2,c,plc
35=NextPartPressX1,301:16.0:4,c,plc
36=NextPartFeed,301:20.0:4,c,plc
37=NextPartAcc,301:24.0:4,c,plc
38=NextPartRef1,301:28.0:4,c,plc
39=NextPartRef2,301:32.0:4,c,plc
40=Stop_Working,301:1.7:1,c,plc
[Languages]
Enable=0
+5 -3
View File
@@ -9,7 +9,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1d1_DEV1'
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
@@ -135,7 +137,7 @@ EmtGeneral {
AxisMaxRotAdj = 0.5,
ExitMaxAdjust = 30,
ExitMaxRotAdj = 0.5,
AngDeltaMinForHome = 165,
--AngDeltaMinForHome = 165,
NewLinkMgr = 1,
Special = 'Saomad-KAIROS-MK2.mlse',
Processor = 'Saomad-KAIROS-MK2.mlpe'}
+24 -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
@@ -1665,8 +1678,11 @@ function IsLastMachining( nMchId)
local nOpeId = EgtGetNextActiveOperation( nMchId)
while nOpeId do
local nType = EgtGetOperationType( nOpeId)
-- se c'è una lavorazione
if nType ~= MCH_OY.NONE and nType ~= MCH_OY.DISP then
return false
elseif nType == MCH_OY.DISP and IsRestPhase( EMT.PHASE + 1) then
return false
end
nOpeId = EgtGetNextActiveOperation( nOpeId)
end
+18 -3
View File
@@ -28,6 +28,21 @@ function OnSpecialLink()
elseif EMC.LINKTYPE == 2 then
-- altrimenti collegamento tra due lavorazioni (3)
else
local nClId = EgtGetFirstNameInGroup( EMC.NEXTMCHID, 'CL') -- recupero Id del gruppo CL della lavorazione corrente
local nPathId = EgtGetFirstInGroup( nClId or GDB_ID.NULL) -- Id del primo gruppo nella lavorazione (P1)
local dAuxMoveCount = EgtGetInfo( nPathId, 'AS#', 'd') or 0 -- numero di movimenti ausiliari
-- se ci sono stati movimenti di pinze vado a una quota sicura
if dAuxMoveCount > 3 then
-- recupero quota massima di collegamento
local dZSecRotAx = 500
-- retrazione
EmtRemoveRise( EMC.PREVMCHID)
EmtAddRise( EMC.PREVMCHID, { EMC.L1p, EMC.L2p, dZSecRotAx, EMC.R1p, EMC.R2p}, 30, 3, 2, 'UniqueRise=1;')
-- approccio
EmtRemoveClimb( EMC.NEXTMCHID)
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, dZSecRotAx, EMC.R1, EMC.R2}, 31, 2, 2, 'FirstClimb=1;')
EmtAddClimb( EMC.NEXTMCHID, { EMC.L1, EMC.L2, EMC.L3, EMC.R1, EMC.R2}, 30, 2, 2, 'LastClimb=1;')
end
end
-- se motosega
elseif EMC.HEAD == 'H3' then
@@ -1568,7 +1583,7 @@ function SpecCalcUnload()
EMC.X1DELTANEXT = nil
EMC.X2DELTANEXT = dX2LastPos
-- effettuo scambio
vCmdPre = GetCarriagesRepositioningCmd( vCmdPre, EMC.TPOS, EMC.X1DELTA, nil, nil, nil, dX2LastPos)
vCmdPre = GetCarriagesRepositioningCmd( vCmdPre, EMC.TPOS, EMC.X1DELTA, dX2CurrPos, nil, nil, dX2LastPos)
if EMC.ERR ~= 0 then
return {}
end
@@ -1582,7 +1597,7 @@ function SpecCalcUnload()
-- Commento
table.insert( vCmd, { 0, 'Unloading', EgtIf( bStdUl, 'Unloading', 'Manual Unloading')})
-- risalita testa a Zmax
vCmd = AddZmaxMove( vCmd)
-- vCmd = AddZmaxMove( vCmd)
-- Se pinza X1 chiusa, la apro
if EMC.X1DELTA then
table.insert( vCmd, { 11, 0})
@@ -1704,7 +1719,7 @@ function GetCarriagesRepositioningCmd( vCmd, dTPosI, dX1DeltaI, dX2DeltaI, dTPos
if #vCmd == 0 then
table.insert( vCmd, { 0, 'Clamp repositioning'})
-- risalita testa a Zmax
vCmd = AddZmaxMove( vCmd)
-- vCmd = AddZmaxMove( vCmd)
end
-- si ribadisce il pinzaggio