Essetre-90480030 25d2 :
- modifiche per lavorazioni in doppio verticali.
This commit is contained in:
@@ -329,7 +329,7 @@ Active=1
|
||||
[ToolHolder]
|
||||
H1.1=Standard.nge
|
||||
H1.1:MILL_NOTIP=MillNoTip.nge
|
||||
H2.1=
|
||||
H2.1=SawOnH2.nge
|
||||
H3.1=ChainSaw.nge
|
||||
H7.1=Standard.nge
|
||||
H7.1:MILL_NOTIP=MillNoTip.nge
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
-- Descrizione macchina Essetre-90480030 by Egalware s.r.l. 2023/03/10
|
||||
-- Descrizione macchina Essetre-90480030 by Egalware s.r.l. 2023/04/12
|
||||
-- Macchina Wall.
|
||||
|
||||
require( 'EmtGenerator')
|
||||
EgtEnableDebug( false)
|
||||
|
||||
PP_VER = '2.5c9'
|
||||
PP_VER = '2.5d2'
|
||||
|
||||
-- Parametri macchina
|
||||
NumericalControl = 'NUM' -- NUM o TPA
|
||||
@@ -12,7 +12,7 @@ MinY = 0.0
|
||||
MaxY = 18200.0
|
||||
MinX1 = -6685.0
|
||||
MaxX1 = -770.0
|
||||
ParkTSpecX1 = -4000
|
||||
ParkTSpecX1 = -4200
|
||||
MinZ1 = -1585.0
|
||||
MaxZ1 = 0.0
|
||||
MinB1 = -135.0
|
||||
@@ -35,6 +35,7 @@ SawDeltaZ = -115.0
|
||||
SawOffs = 163.5
|
||||
MinX3 = -5915.0
|
||||
MaxX3 = 0.0
|
||||
ParkTSpecX3 = -3000
|
||||
MinZ3 = -1585.0
|
||||
MaxZ3 = 0.0
|
||||
MinB3 = -135.0
|
||||
@@ -45,6 +46,8 @@ Mill3DeltaX = 0.0
|
||||
Mill3DeltaY = 0.0
|
||||
Mill3DeltaZ = 0.0
|
||||
Mill3Offs = 202.0
|
||||
MinDeltaX1X3 = 770
|
||||
MinDistToolX1X3 = 40
|
||||
DimTabX = 16800.0
|
||||
DimTabY = 3500.0
|
||||
DeltaTabX = -( -17639.65 + DimTabX)
|
||||
|
||||
Binary file not shown.
+103
-15
@@ -1,4 +1,4 @@
|
||||
-- Processore macchina Essetre-WALL by EgalTech s.r.l. 2023/03/07
|
||||
-- Processore macchina Essetre-WALL by EgalTech s.r.l. 2023/04/12
|
||||
-- Con controllo numerico NUM
|
||||
|
||||
-- Variabili di modulo
|
||||
@@ -182,6 +182,7 @@ function OnToolSelect()
|
||||
EMT.TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
EMT.TDIST = EgtTdbGetCurrToolParam( MCH_TP.DIST)
|
||||
if EMT.TDIST and abs( EMT.TDIST) < 1 then EMT.TDIST = nil end
|
||||
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -194,7 +195,44 @@ function OnMachiningStart()
|
||||
--EMT.MCHLIBNAME = EgtGetMachiningParam( MCH_MP.NAME)
|
||||
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
|
||||
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
|
||||
EMT.USERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
EMT.MCHWS = EgtGetMachiningParam( MCH_MP.WORKSIDE) or 0
|
||||
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
-- gestione eventuale lavorazione in doppio
|
||||
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
|
||||
if nDouType == 2 or nDouType == 3 then
|
||||
local sDouTool = EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
|
||||
local sOldTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
if EgtTdbSetCurrTool( sDouTool) and EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
||||
-- salvo dati
|
||||
EMT.DOU_TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
EMT.DOU_TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
EMT.DOU_TYPE = nDouType
|
||||
EMT.DOU_TOOL = sDouTool
|
||||
EMT.DOU_HEAD = 'H7'
|
||||
EMT.DOU_EXIT = 1
|
||||
EMT.DOU_TPOS = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
EMT.DOU_SPEED = EgtTdbGetCurrToolParam( MCH_TP.SPEED)
|
||||
EMT.DOU_MIRRORAX = EgtGetValInNotes( EMT.MCHUSERNOTES, 'MirrorAx', 'd')
|
||||
EMT.DOU_DELTAZ = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DeltaZ', 'd') or 0
|
||||
if not EMT.DOU_MIRRORAX then
|
||||
EmtSetLastError( 1211, 'Missing MirrorAx position of '..sOldTool)
|
||||
end
|
||||
-- imposto correttamente i dati della testa 3
|
||||
local OrigEMC = EMC
|
||||
EMC = { HEAD = EMT.DOU_HEAD, TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)}
|
||||
OnSetHead()
|
||||
EMC = OrigEMC
|
||||
-- non va in sicurezza testa in doppio
|
||||
EMT.DOU_TO_ZMAX = nil
|
||||
else
|
||||
EmtSetLastError( 1211, 'Missing or not active double tool of '..sOldTool)
|
||||
end
|
||||
EgtTdbSetCurrTool( sOldTool)
|
||||
end
|
||||
-- se testa in doppio ancora da rimettere in sicurezza
|
||||
if EMT.DOU_TO_ZMAX then
|
||||
;
|
||||
end
|
||||
-- non ancora iniziata la lavorazione
|
||||
EMT.MCHFIRST = true
|
||||
-- primo posizionamento sempre in globale
|
||||
@@ -208,6 +246,7 @@ function OnMachiningEnd()
|
||||
EmtOutput( 'G103'..GetET()..GetEN()..' E80000='..tostring( EMT.CNT + 1))
|
||||
end
|
||||
EMT.PREVTOOL = EMT.TOOL
|
||||
EMT.DOU_TYPE = nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -226,7 +265,9 @@ function OnRapid()
|
||||
if EMT.MCHFIRST and not EMT.OPEISDISP then
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmtOutput( '( *** '..EMT.MCHNAME..'/'..EMT.TOOL..' *** )')
|
||||
local sTitle = EMT.MCHNAME..'/'..EMT.TOOL
|
||||
if EMT.DOU_TYPE then sTitle = sTitle .. ' Double' end
|
||||
EmtOutput( '( *** ' .. sTitle .. ' *** )')
|
||||
EmitCount()
|
||||
-- se lavorazione con sega a catena
|
||||
if EMT.HEAD == 'H3' then
|
||||
@@ -258,7 +299,7 @@ function OnRapid()
|
||||
-- altrimenti verifico se necessaria pausa
|
||||
else
|
||||
local bSystemSR = ( EMT.SCRAPFIRST and EgtExistsInfo( EMT.MCHID, 'MOVE_AFTER'))
|
||||
local bUserSR = ( EgtGetValInNotes( EMT.USERNOTES, 'ScrapRemove', 'i') == 1)
|
||||
local bUserSR = ( EgtGetValInNotes( EMT.MCHUSERNOTES, 'ScrapRemove', 'i') == 1)
|
||||
if bSystemSR or bUserSR then
|
||||
if bSystemSR then EMT.SCRAPFIRST = false end
|
||||
-- pausa per rimozione sfridi
|
||||
@@ -287,17 +328,33 @@ function OnRapid()
|
||||
end
|
||||
-- primo posizionamento
|
||||
EmtResetPrev()
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L1') .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1')
|
||||
local sOut = 'G101'
|
||||
if EMT.DOU_TYPE ~= 2 then
|
||||
sOut = sOut .. EmtGetAxis( 'L1') .. EmtGetAxis( 'L2') .. EmtGetAxis( 'L3') ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1')
|
||||
else
|
||||
local Z1 = EMT.L3
|
||||
local X3 = EMT.L2 + 2 * ( EMT.DOU_MIRRORAX + DeltaTabY - EMT.L2) - Mill3DeltaY
|
||||
local Z3 = EMT.L3 - Mill3DeltaZ - EMT.TLEN + EMT.DOU_TLEN + EMT.DOU_DELTAZ
|
||||
if Z3 > MaxZ3 then
|
||||
Z1 = Z1 - ( Z3 - MaxZ3)
|
||||
Z3 = MaxZ3
|
||||
end
|
||||
sOut = sOut .. EmtGetAxis( 'L1') .. EmtGetAxis( 'L2') .. ' Z' .. EmtLenToString( Z1, 3) ..
|
||||
EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') ..
|
||||
' U' .. EmtLenToString( X3, 3) .. ' W' .. EmtLenToString( Z3, 3) .. ' V' .. EgtNumToString( -EMT.R2, 3) .. ' A' .. EgtNumToString( -EMT.R1, 3)
|
||||
end
|
||||
local sET = GetET()
|
||||
local sEU = GetEU()
|
||||
local sEF = GetEF()
|
||||
local sEN = GetEN()
|
||||
local sEM = ' EM0 EO0'
|
||||
local sEM = ' EM0'
|
||||
if EMT.DOU_TYPE == 2 then sEM = ' EM'..EgtNumToString( EMT.DOU_SPEED, 0) end
|
||||
local sEO = GetEO()
|
||||
local sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
|
||||
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
|
||||
sOut = sOut .. sET .. sEU .. sEF .. sEN .. sEM .. sES .. sEL .. sER
|
||||
sOut = sOut .. sET .. sEU .. sEF .. sEN .. sEM .. sEO .. sES .. sEL .. sER
|
||||
EmtOutput( sOut)
|
||||
EMT.REFLOC = 0
|
||||
EMT.MCHFIRST = false
|
||||
@@ -318,11 +375,14 @@ function OnRapid()
|
||||
local sET = GetET()
|
||||
local sEU = GetEU()
|
||||
local sEF = ' EF20000'
|
||||
local sEM = ' EN0 EM0 EO0'
|
||||
local sEN = GetEN()
|
||||
local sEM = ' EM0'
|
||||
if EMT.DOU_TYPE == 2 then sEM = ' EM'..EgtNumToString( EMT.DOU_SPEED, 0) end
|
||||
local sEO = GetEO()
|
||||
local sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
|
||||
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
|
||||
EmtOutput( 'G102'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EmtGetAxis('R2')..EmtGetAxis('R1')..EMT.IPLGLSTR..sET..sEU..sEF..sEM..sES..sEL..sER)
|
||||
EmtOutput( 'G102'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EmtGetAxis('R2')..EmtGetAxis('R1')..EMT.IPLGLSTR..sET..sEU..sEF..sEN..sEM..sEO..sES..sEL..sER)
|
||||
else
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
@@ -343,11 +403,25 @@ function OnRapid()
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
if not IsSpecialTool( EMT.TCPOS) then
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. GetET() .. GetEN() .. GetEF()
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1')
|
||||
if EMT.DOU_TYPE == 2 then
|
||||
local Z3 = EMT.L3 - Mill3DeltaZ - EMT.TLEN + EMT.DOU_TLEN
|
||||
Z3 = min( Z3, MaxZ3)
|
||||
sOut = sOut .. ' W' .. EmtLenToString( Z3, 3) .. ' V' .. EgtNumToString( -EMT.R2, 3) .. ' A' .. EgtNumToString( -EMT.R1, 3)
|
||||
end
|
||||
sOut = sOut .. GetET() .. GetEN() .. GetEF()
|
||||
EmtOutput( sOut)
|
||||
else
|
||||
if EMT.TCPOS ~= 'T101' then
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. GetET() .. GetEN().. ' EU50' .. GetEF()
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1')
|
||||
local sEU_EO = ' EU50'
|
||||
if EMT.DOU_TYPE == 2 then
|
||||
local Z3 = EMT.L3 - Mill3DeltaZ - EMT.TLEN + EMT.DOU_TLEN
|
||||
Z3 = min( Z3, MaxZ3)
|
||||
sOut = sOut .. ' W' .. EmtLenToString( Z3, 3) .. ' V' .. EgtNumToString( -EMT.R2, 3) .. ' A' .. EgtNumToString( -EMT.R1, 3)
|
||||
sEU_EO = sEU_EO .. ' EO50'
|
||||
end
|
||||
sOut = sOut .. GetET() .. GetEN().. sEU_EO .. GetEF()
|
||||
EmtOutput( sOut)
|
||||
elseif EMT.ADIR[3] > 0.708 then
|
||||
local sOut = 'G101' .. EmtGetAxis( 'L3') .. EmtGetAxis( 'R2') .. EmtGetAxis( 'R1') .. GetET() .. GetEN() .. GetEF()
|
||||
@@ -392,11 +466,14 @@ function OnLinear()
|
||||
local sET = GetET()
|
||||
local sEU = GetEU()
|
||||
local sEF = ' EF20000'
|
||||
local sEM = ' EN0 EM0 EO0'
|
||||
local sEN = GetEN()
|
||||
local sEM = ' EM0'
|
||||
if EMT.DOU_TYPE == 2 then sEM = ' EM'..EgtNumToString( EMT.DOU_SPEED, 0) end
|
||||
local sEO = GetEO()
|
||||
local sES = ' ES'..EgtNumToString( EMT.S, 0)
|
||||
local sEL = ' EL' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TLEN, ( EMT.TDIST or ChSawLen)), 3)
|
||||
local sER = ' ER' .. EmtLenToString( EgtIf( EMT.HEAD ~= 'H3', EMT.TDIAM / 2, EMT.TLEN), 3)
|
||||
EmtOutput( 'G102'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..sET..sEU..sEF..sEM..sES..sEL..sER)
|
||||
EmtOutput( 'G102'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..EMT.IPLGLSTR..sET..sEU..sEF..sEN..sEM..sEO..sES..sEL..sER)
|
||||
-- emissione movimento
|
||||
local sOut = 'G0'..EmtGetAxis('L1')..EmtGetAxis('L2')..EmtGetAxis('L3')..
|
||||
EmtGetAxis('R2')..EmtGetAxis('R1')
|
||||
@@ -553,7 +630,9 @@ end
|
||||
---------------------------------------------------------------------
|
||||
function GetEN()
|
||||
local sEN = ' EN3'
|
||||
if EMT.HEAD == 'H1' or EMT.HEAD == 'H3' then
|
||||
if EMT.DOU_TYPE == 2 then
|
||||
sEN = ' EN2'
|
||||
elseif EMT.HEAD == 'H1' or EMT.HEAD == 'H3' then
|
||||
sEN = ' EN1'
|
||||
end
|
||||
return sEN
|
||||
@@ -590,6 +669,15 @@ function GetEU()
|
||||
return sEU
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetEO()
|
||||
local sEO = ' EO0'
|
||||
if EMT.DOU_TYPE == 2 then
|
||||
sEO = ' EO' .. string.sub( EMT.DOU_TPOS, 2)
|
||||
end
|
||||
return sEO
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function GetEF()
|
||||
return ' EF60000'
|
||||
|
||||
+162
-25
@@ -1,4 +1,4 @@
|
||||
-- Processore macchina Essetre-WALL by EgalTech s.r.l. 2023/03/10
|
||||
-- Processore macchina Essetre-WALL by EgalTech s.r.l. 2023/04/12
|
||||
-- Funzioni generiche indipendenti dal controllo
|
||||
|
||||
-- Intestazioni
|
||||
@@ -144,10 +144,9 @@ function OnSimulDispositionStart()
|
||||
EMT.HB = b3Raw:getDimZ()
|
||||
end
|
||||
-- Carico primo utensile sulla testa 1
|
||||
local sTool = FindFirstToolOnHead( 'H1')
|
||||
if sTool then
|
||||
EMT.TOOL_1 = sTool
|
||||
--EgtLoadTool( 'H1', 1, EMT.TOOL_1)
|
||||
local sTool_1 = FindFirstToolOnHead( 'H1')
|
||||
if sTool_1 then
|
||||
EMT.TOOL_1 = sTool_1
|
||||
EgtSetCalcTool( EMT.TOOL_1, 'H1', 1)
|
||||
EgtResetAxisPos( 'C1')
|
||||
EgtResetAxisPos( 'B1')
|
||||
@@ -156,6 +155,18 @@ function OnSimulDispositionStart()
|
||||
else
|
||||
EgtUnloadTool( 'H1', 1)
|
||||
end
|
||||
-- Carico primo utensile sulla testa 7
|
||||
local sTool_3 = FindFirstToolOnHead( 'H7')
|
||||
if sTool_3 then
|
||||
EMT.TOOL_3 = sTool_3
|
||||
EgtSetCalcTool( EMT.TOOL_3, 'H7', 1)
|
||||
EgtResetAxisPos( 'C3')
|
||||
EgtResetAxisPos( 'B3')
|
||||
EMT.TCPOS_3 = GetToolTcPos( EMT.TOOL_3)
|
||||
ShowToolInTcPos( EMT.TCPOS_3, false)
|
||||
else
|
||||
EgtUnloadTool( 'H7', 1)
|
||||
end
|
||||
EMT.FIRST_TOOL = true
|
||||
-- Se vero inizio, abilitato e trovato grezzo, creazione Zmap
|
||||
if not EMT.SIM1ST and EgtGetInfo( EgtGetCurrMachGroup(), 'Vm', 'b') and nRawId then
|
||||
@@ -222,20 +233,17 @@ end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulDispositionEnd()
|
||||
if EMT.UNLOADING or EMT.FALL then
|
||||
EMT.UNLOADING = false
|
||||
EMT.FALL = false
|
||||
end
|
||||
EMT.OPEISDISP = false
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulToolSelect()
|
||||
-- se utensile non definito, è disposizione ed esco
|
||||
if EMT.TOOL == '' then return end
|
||||
-- recupero dati utensile
|
||||
EMT.TOOLTYPE = EgtTdbGetCurrToolParam( MCH_TP.TYPE)
|
||||
EMT.TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
EMT.TOOLTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
EMT.TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
EMT.TUSERNOTES = EgtTdbGetCurrToolParam( MCH_TP.USERNOTES)
|
||||
-- se lama su sua testa (X2), sposto le altre dalla parte opposta
|
||||
if EMT.HEAD == 'H2' then
|
||||
-- parcheggio le altre due teste
|
||||
@@ -328,7 +336,8 @@ function OnSimulToolDeselect()
|
||||
if EMT.HEAD == 'H2' then
|
||||
SimulMoveAxes( 'X2', MinX2, MCH_SIM_STEP.RAPID, 'C2', EgtGetAxisHomePos( 'C2'), MCH_SIM_STEP.RAPROT, 'B2', EgtGetAxisHomePos( 'B2'), MCH_SIM_STEP.RAPROT)
|
||||
elseif EMT.HEAD == 'H7' then
|
||||
SimulMoveAxes( 'X3', MaxX3, MCH_SIM_STEP.RAPID, 'C3', EgtGetAxisHomePos( 'C3'), MCH_SIM_STEP.RAPROT, 'B3', EgtGetAxisHomePos( 'B3'), MCH_SIM_STEP.RAPROT)
|
||||
local PosX3 = EgtIf( IsSpecialTool( EMT.TCPOS), ParkTSpecX3, MaxX3)
|
||||
SimulMoveAxes( 'X3', PosX3, MCH_SIM_STEP.RAPID, 'C3', EgtGetAxisHomePos( 'C3'), MCH_SIM_STEP.RAPROT, 'B3', EgtGetAxisHomePos( 'B3'), MCH_SIM_STEP.RAPROT)
|
||||
else -- H1 o H3
|
||||
local PosX1 = EgtIf( IsSpecialTool( EMT.TCPOS), ParkTSpecX1, MaxX1)
|
||||
SimulMoveAxes( 'X1', PosX1, MCH_SIM_STEP.RAPID, 'C1', EgtGetAxisHomePos( 'C1'), MCH_SIM_STEP.RAPROT, 'B1', EgtGetAxisHomePos( 'B1'), MCH_SIM_STEP.RAPROT)
|
||||
@@ -341,7 +350,7 @@ function OnSimulToolDeselect()
|
||||
EgtPause( 100)
|
||||
ShowToolInTcPos( EMT.TCPOS_1, true)
|
||||
-- nascondo l'utensile corrente
|
||||
EgtSetStatus( EgtGetHeadId( EMT.HEAD), GDB_ST.OFF)
|
||||
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
|
||||
-- se segue utensile speciale
|
||||
if IsSpecialTool( EMT.NEXTTCPOS) then
|
||||
-- eseguo movimento opportuno
|
||||
@@ -364,7 +373,8 @@ function OnSimulMachiningStart()
|
||||
-- recupero alcuni dati della lavorazione
|
||||
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
|
||||
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
EMT.MCHWS = EgtGetMachiningParam( MCH_MP.WORKSIDE) or 0
|
||||
EMT.MCHUSERNOTES = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
EMT.VMRS = false
|
||||
-- recupero CUTID e TASKID della feature lavorata
|
||||
local vId = EgtGetMachiningGeometry()
|
||||
@@ -378,7 +388,7 @@ function OnSimulMachiningStart()
|
||||
end
|
||||
-- eventuale pausa per rimozione sfridi
|
||||
local bSystemSR = ( EMT.SCRAPFIRST and (( EMT.HEAD == 'H3' and string.sub( EMT.MCHNAME, 1, 5) == 'Csaw_') or EgtExistsInfo( EMT.MCHID, 'MOVE_AFTER')))
|
||||
local bUserSR = ( EgtGetValInNotes( sNotes, 'ScrapRemove', 'i') == 1)
|
||||
local bUserSR = ( EgtGetValInNotes( EMT.MCHUSERNOTES, 'ScrapRemove', 'i') == 1)
|
||||
if bSystemSR or bUserSR then
|
||||
if bSystemSR then EMT.SCRAPFIRST = false end
|
||||
EgtOutText( 'Pause for Scrap Remove')
|
||||
@@ -387,16 +397,67 @@ function OnSimulMachiningStart()
|
||||
EgtPause( 500)
|
||||
EgtOutText( '')
|
||||
end
|
||||
-- gestione eventuale lavorazione in doppio
|
||||
local nDouType = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DOUBLE', 'i')
|
||||
if nDouType == 2 then
|
||||
local sDouTool = EgtGetValInNotes( EMT.TUSERNOTES, 'DOUBLE', 's') or ''
|
||||
local sOldTool = EgtTdbGetCurrToolParam( MCH_TP.NAME)
|
||||
if EgtTdbSetCurrTool( sDouTool) and EgtTdbGetCurrToolParam( MCH_TP.ACTIVE) then
|
||||
local sDouHead = 'H7'
|
||||
local nDouExit = 1
|
||||
if sDouTool ~= EMT.TOOL_3 then
|
||||
-- carico l'utensile sulla testa
|
||||
local sTcPos = EgtTdbGetCurrToolParam( MCH_TP.TCPOS)
|
||||
EgtLoadTool( sDouHead, nDouExit, sDouTool)
|
||||
ShowToolInTcPos( sTcPos, false)
|
||||
-- riposiziono eventuale precedente utensile sul TC
|
||||
if EMT.TCPOS_3 then ShowToolInTcPos( EMT.TCPOS_3, true) end
|
||||
-- salvo utensile montato su testa
|
||||
EMT.TOOL_3 = sDouTool
|
||||
EMT.TCPOS_3 = sTcPos
|
||||
-- se utensile speciale, posiziono opportunamente la testa
|
||||
if IsSpecialTool( EMT.TCPOS_3) then
|
||||
EgtSetAxisPos( 'X3', ParkTSpecX3)
|
||||
end
|
||||
-- dichiaro utensile per Vmill
|
||||
EmtAddToolForVmill( sDouTool, sDouHead, nDouExit, EMT.VMILL)
|
||||
-- dichiaro utensile per verifica collisioni
|
||||
local nInd = 1031
|
||||
AddToolToCollisionObj( sDouTool, sDouHead, nDouExit, nInd, true)
|
||||
AddToolHolderToCollisionObj( sDouTool, sDouHead, nDouExit, nInd + 1)
|
||||
end
|
||||
-- salvo dati
|
||||
EMT.DOU_TLEN = EgtTdbGetCurrToolParam( MCH_TP.LEN)
|
||||
EMT.DOU_TTOTLEN = EgtTdbGetCurrToolParam( MCH_TP.TOTLEN)
|
||||
EMT.DOU_TDIAM = EgtTdbGetCurrToolParam( MCH_TP.DIAM)
|
||||
EMT.DOU_TYPE = nDouType
|
||||
EMT.DOU_TOOL = sDouTool
|
||||
EMT.DOU_MIRRORAX = EgtGetValInNotes( EMT.MCHUSERNOTES, 'MirrorAx', 'd')
|
||||
EMT.DOU_DELTAZ = EgtGetValInNotes( EMT.MCHUSERNOTES, 'DeltaZ', 'd') or 0
|
||||
if not EMT.DOU_MIRRORAX then
|
||||
EmtSetLastError( 1211, 'Missing MirrorAx position of '..sOldTool)
|
||||
end
|
||||
-- reset necessità movimento in sicurezza sola testa in doppio
|
||||
EMT.DOU_TO_ZMAX = nil
|
||||
else
|
||||
EmtSetLastError( 1211, 'Missing or not active double tool of '..EMT.MCHNAME)
|
||||
end
|
||||
EgtTdbSetCurrTool( sOldTool)
|
||||
end
|
||||
-- se precedente in doppio ma ora solo testa 1 e non in sicurezza
|
||||
if EMT.DOU_TO_ZMAX then
|
||||
-- eseguo
|
||||
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID, 'B3', 0, MCH_SIM_STEP.COLLROT, 'C3', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxis( 'X3', MaxZ3, MCH_SIM_STEP.RAPID)
|
||||
EMT.DOU_TO_ZMAX = nil
|
||||
end
|
||||
-- non ancora iniziata la lavorazione
|
||||
EMT.MCHFIRST = true
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulMachiningEnd()
|
||||
if EMT.UNLOADING or EMT.FALL then
|
||||
EMT.UNLOADING = false
|
||||
EMT.FALL = false
|
||||
end
|
||||
EMT.DOU_TYPE = nil
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
@@ -447,17 +508,93 @@ end
|
||||
function OnSimulPathEndAux()
|
||||
--EgtOutLog( 'OnSimulPathEndAux - ' .. EgtNumToString( EMT.AUXIND, 0) .. ' - ' .. EMT.AUX)
|
||||
EgtOutLog( 'OnSimulPathEndAux', 5)
|
||||
-- eseguo il comando
|
||||
--ExecAuxCmd( EMT.AUX)
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
--function OnSimulMoveStart()
|
||||
--end
|
||||
function OnSimulMoveStart()
|
||||
-- se lavorazione in doppio
|
||||
if EMT.DOU_TYPE == 2 and not ( EMT.MOVE == 0 and ( EMT.FLAG == 3 or EMT.FLAG == 4)) then
|
||||
EMT.AuxAxes = 4
|
||||
EMT.A1n = 'X3'
|
||||
local X3 = EMT.L2 + 2 * ( EMT.DOU_MIRRORAX + DeltaTabY - EMT.L2) - Mill3DeltaY
|
||||
EMT.A1 = X3
|
||||
EMT.A1m = EgtIf( ( EMT.MOVE == 2 or EMT.MOVE == 3), '-X1', nil)
|
||||
EMT.A2n = 'Z3'
|
||||
local Z3 = EMT.L3 - Mill3DeltaZ - EMT.TLEN + EMT.DOU_TLEN + EMT.DOU_DELTAZ
|
||||
EMT.A2 = min( Z3, MaxZ3)
|
||||
EMT.A2m = EgtIf( ( EMT.MOVE == 2 or EMT.MOVE == 3), 'Z1', nil)
|
||||
EMT.A3n = 'C3'
|
||||
EMT.A3 = -EMT.R1
|
||||
EMT.A4n = 'B3'
|
||||
EMT.A4 = -EMT.R2
|
||||
-- controllo minimo interasse tra X1 e X3
|
||||
local dDeltaX1X3 = 2 * ( EMT.DOU_MIRRORAX + DeltaTabY - EMT.L2) - Mill3DeltaY
|
||||
if dDeltaX1X3 < MinDeltaX1X3 then
|
||||
local sErr = 'X1 X3 charriots in collision (distance=' .. EgtNumToString( dDeltaX1X3, 1) .. ')'
|
||||
EmtSetLastError( 1208, sErr)
|
||||
end
|
||||
-- controllo minima distanza tra utensili di X1 e X3
|
||||
--local dDistToolX1X3 = dDeltaX1X3 - MillOffs - EMT.TTOTLEN - Mill2Offs - EMT.DOU_TTOTLEN
|
||||
--if dDistToolX1X3 < MinDistToolX1X3 then
|
||||
-- local sErr = 'X1 X3 tools in collision (distance=' .. EgtNumToString( dDistToolX1X3, 1) .. ')'
|
||||
-- EmtSetLastError( 1208, sErr)
|
||||
--end
|
||||
end
|
||||
-- se posizionamento in home, verifico se utensile speciale da depositare prima
|
||||
if EMT.MOVE == 0 and EMT.FLAG == 4 then
|
||||
-- se lavorazione in doppio
|
||||
if EMT.DOU_TYPE == 2 then
|
||||
-- se utensile speciale
|
||||
if IsSpecialTool( EMT.TCPOS_3) then
|
||||
-- eseguo movimento opportuno
|
||||
SimulMoveAxes( 'B3', 0, MCH_SIM_STEP.COLLROT, 'C3', 0, MCH_SIM_STEP.COLLROT)
|
||||
if EMT.L2p > ParkTSpecX1 then
|
||||
SimulMoveAxes( 'X1', ParkTSpecX1, MCH_SIM_STEP.RAPID, 'X3', ParkTSpecX3, MCH_SIM_STEP.RAPID)
|
||||
else
|
||||
SimulMoveAxis( 'X3', ParkTSpecX3, MCH_SIM_STEP.RAPID)
|
||||
end
|
||||
-- nascondo l'utensile sulla testa e lo visualizzo sul TC
|
||||
EgtSetMode( EgtGetHeadId( 'H7'), GDB_MD.HIDDEN)
|
||||
ShowToolInTcPos( EMT.TCPOS_3, true)
|
||||
EMT.TOOL_3 = nil
|
||||
EMT.TCPOS_3 = nil
|
||||
-- vado in home
|
||||
SimulMoveAxis( 'X3', MaxX3, MCH_SIM_STEP.RAPID)
|
||||
end
|
||||
end
|
||||
-- se utensile speciale su testa 1
|
||||
if EMT.HEAD == 'H1' and IsSpecialTool( EMT.TCPOS) then
|
||||
-- eseguo movimento opportuno
|
||||
SimulMoveAxes( 'B1', 0, MCH_SIM_STEP.COLLROT, 'C1', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'X1', ParkTSpecX1, MCH_SIM_STEP.RAPID)
|
||||
-- nascondo l'utensile sulla testa e lo visualizzo sul TC
|
||||
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
|
||||
ShowToolInTcPos( EMT.TCPOS_1, true)
|
||||
EMT.TOOL_1 = nil
|
||||
EMT.TCPOS_1 = nil
|
||||
-- se altrimenti utensile speciale su testa 3
|
||||
elseif EMT.HEAD == 'H7' and IsSpecialTool( EMT.TCPOS) then
|
||||
-- eseguo movimento opportuno
|
||||
SimulMoveAxes( 'B3', 0, MCH_SIM_STEP.COLLROT, 'C3', 0, MCH_SIM_STEP.COLLROT)
|
||||
SimulMoveAxes( 'X3', ParkTSpecX1, MCH_SIM_STEP.RAPID)
|
||||
-- nascondo l'utensile sulla testa e lo visualizzo sul TC
|
||||
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
|
||||
ShowToolInTcPos( EMT.TCPOS_3, true)
|
||||
EMT.TOOL_3 = nil
|
||||
EMT.TCPOS_3 = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
--function OnSimulMoveEnd()
|
||||
--end
|
||||
function OnSimulMoveEnd()
|
||||
-- se Zmax dopo fine lavorazione
|
||||
if EMT.DOU_TYPE == 2 and EMT.MOVE == 0 and EMT.FLAG == 3 then
|
||||
-- eseguo risalita in sicurezza
|
||||
SimulMoveAxes( 'Z3', MaxZ3, MCH_SIM_STEP.RAPID, 'B3', 0, MCH_SIM_STEP.COLLROT, 'C3', 0, MCH_SIM_STEP.COLLROT)
|
||||
EMT.DOU_TO_ZMAX = nil
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulCollision()
|
||||
|
||||
+27
-27
@@ -28,33 +28,33 @@ local POS = "Pos"
|
||||
local GS = {}
|
||||
|
||||
-- Configurazione posizioni
|
||||
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos2", TcPos = "T2", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos3", TcPos = "T3", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos4", TcPos = "T4", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos5", TcPos = "T5", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos6", TcPos = "T6", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos7", TcPos = "T7", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos9", TcPos = "T9", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos10", TcPos = "T10", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos11", TcPos = "T11", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos12", TcPos = "T12", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos13", TcPos = "T13", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos14", TcPos = "T14", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos15", TcPos = "T15", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos16", TcPos = "T16", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos17", TcPos = "T17", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos18", TcPos = "T18", Head = "H7", Group = "G2"},
|
||||
{Pos = "Pos19", TcPos = "T20", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos20", TcPos = "T21", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos21", TcPos = "T22", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos22", TcPos = "T23", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos23", TcPos = "T24", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos24", TcPos = "T25", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos25", TcPos = "T26", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos26", TcPos = "T27", Head = "H1", Group = "G3"},
|
||||
{Pos = "Pos27", TcPos = "T28", Head = "H1", Group = "G3"},
|
||||
local PositionTable={{Pos = "Pos1", TcPos = "T1", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos2", TcPos = "T2", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos3", TcPos = "T3", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos4", TcPos = "T4", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos5", TcPos = "T5", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos6", TcPos = "T6", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos7", TcPos = "T7", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos8", TcPos = "T8", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos9", TcPos = "T9", Head = "H1", Group = "G2"},
|
||||
{Pos = "Pos10", TcPos = "T10", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos11", TcPos = "T11", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos12", TcPos = "T12", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos13", TcPos = "T13", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos14", TcPos = "T14", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos15", TcPos = "T15", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos16", TcPos = "T16", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos17", TcPos = "T17", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos18", TcPos = "T18", Head = "H7", Group = "G3"},
|
||||
{Pos = "Pos19", TcPos = "T20", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos20", TcPos = "T21", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos21", TcPos = "T22", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos22", TcPos = "T23", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos23", TcPos = "T24", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos24", TcPos = "T25", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos25", TcPos = "T26", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos26", TcPos = "T27", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos27", TcPos = "T28", Head = "H1", Group = "G1"},
|
||||
{Pos = "Pos28", TcPos = "T42", Head = "H2", Group = "G4"},
|
||||
{Pos = "Pos29", TcPos = "T101", Head = "H3", Group = "G4"},
|
||||
{Pos = "Pos30", TcPos = "T201", Head = "H1", Group = "G4"},
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
6=Text
|
||||
7=CleanCorner60
|
||||
8=CleanCorner30
|
||||
9=SideMill
|
||||
10=Gorge
|
||||
|
||||
[Pocketing]
|
||||
1=Pocket
|
||||
|
||||
+4
-2
@@ -1,7 +1,7 @@
|
||||
-- WallData.lua by Egaltech s.r.l. 2023/03/06
|
||||
-- WallData.lua by Egaltech s.r.l. 2023/04/15
|
||||
-- Raccolta dati generali per Pareti
|
||||
|
||||
EgtOutLog( ' 90480024-WallData started', 1)
|
||||
EgtOutLog( ' 90480030-WallData started', 1)
|
||||
|
||||
-- Tabella per definizione modulo
|
||||
local WallData = {
|
||||
@@ -35,6 +35,8 @@ local WallData = {
|
||||
NESTING_CORNER = 'BR', -- angolo di origine del grezzo per posizionamento pezzi (BR (defualt), TR, BL, TL)
|
||||
DELTA_X = 0, -- allontanamento in X dai riferimenti
|
||||
DELTA_Y = 0, -- allontanamento in Y dai riferimenti
|
||||
RAWPART_ROT = 0, -- rotazione del pannello grezzo rispetto alla descrizione BTL
|
||||
CUT_WITH_OUTLINE = true, -- taglio delle feature con l'outline del pezzo
|
||||
}
|
||||
|
||||
-- Aggiornamento con dati da TechnoEssetre7
|
||||
|
||||
Reference in New Issue
Block a user