Compare commits

..

22 Commits

Author SHA1 Message Date
andrea.villa 04f4aa8db4 - Allineamento con common ver. 2.6d2
- Aggiunto parametro ForceToCloseRollersGate
2024-04-12 08:47:19 +02:00
andrea.villa 79b64b00b5 Merge branch 'develop' 2024-03-28 12:22:50 +01:00
andrea.villa 7924bf6f43 Allineamento con common ver. 2.6d1 2024-03-28 12:22:43 +01:00
andrea.villa eaba71148c Con aggregati, non viene più aggiunto il gruippo SOLID (in MLDE) 2024-03-26 08:12:42 +01:00
andrea.villa 245a052c6c Merge branch 'master' into develop 2024-03-26 08:10:39 +01:00
andrea.villa 879a700c70 Allineamento con common ver. 2.6c7 2024-03-11 10:05:44 +01:00
luca.mazzoleni 26282a4571 aggiunti portautensili custom 2024-03-08 17:56:39 +01:00
andrea.villa 5c50ad117c Allineamento con common ver. 2.6c6 2024-03-08 13:13:54 +01:00
andrea.villa 5ec66b14b8 Piccole migliorie common 2.6c5 2024-03-07 14:37:29 +01:00
andrea.villa 37a2fb6c5c Allineamento con common ver. 2.6c5 2024-03-07 10:48:11 +01:00
luca.mazzoleni 864b59d5bc - corretta versione
- disabilitato debug
2024-03-06 17:53:27 +01:00
andrea.villa fa16abc878 Piccola correzione movimento Z-MAX lama (no aggiornamento versione) 2024-03-06 17:30:00 +01:00
andrea.villa 0a11dd15a1 Allineamento con common ver. 2.6c4 2024-03-06 16:16:22 +01:00
andrea.villa 072a34ffc3 Merge branch 'develop' 2024-03-04 10:59:23 +01:00
andrea.villa 537b77643f - Modificato log con nome macchina
- Allineamento con common ver. 2.6c2
2024-03-04 10:59:13 +01:00
luca.mazzoleni 40a7015016 - in compilazione rimossi i simboli di debug 2024-02-29 18:26:04 +01:00
andrea.villa 32816dd287 Merge branch 'master' into develop 2024-02-29 09:53:11 +01:00
andrea.villa c1fff58e93 Allineamento con common ver. 2.6c1 2024-02-29 09:53:01 +01:00
luca.mazzoleni 925da8106b Merge branch 'master' into develop 2024-02-27 09:45:06 +01:00
luca.mazzoleni e9f1645329 Merge branch 'develop' 2024-02-27 09:44:54 +01:00
luca.mazzoleni dafa913d46 update compile 2024-02-27 09:44:45 +01:00
luca.mazzoleni cafe6f242b Merge branch 'master' into develop 2024-02-27 09:32:03 +01:00
11 changed files with 276 additions and 105 deletions
+85 -40
View File
@@ -6,7 +6,7 @@ local BD = require( 'BeamData')
-- Variabili di modulo
local CSP_INFO = INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
local MACHINE_INFO = 'PP_VER ver.'..PP_VER
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
local TEST_USE = false
@@ -42,13 +42,17 @@ function OnProgramStart()
local BtlInfoId = EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or EgtGetCurrMachGroup() or GDB_ID.NULL
local nPattId = EgtGetInfo( BtlInfoId, 'PATTID', 'i') or 40
EmtOutput( '%' .. EgtNumToString( nPattId,-1))
-- aggiungo prefisso per commentae commenti iniziali se la macchina è utilizzata per fare i test
local sPrefixCommentLine = '' ; if IS_TEST_MACHINE then sPrefixCommentLine = '//' end
if EMT.INFO then
EmtOutput( '('..EMT.INFO..')')
EmtOutput( sPrefixCommentLine..'('..EMT.INFO..')')
else
EmtOutput( '(Program Start)')
end
EmtOutput( '('.. CSP_INFO..')')
EmtOutput( '('.. MACHINE_INFO..')\n')
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
if TEST_USE then
EmitTestProgramStart()
@@ -264,22 +268,38 @@ function OnDispositionEnd()
end
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
if nRot ~= nPrevRot then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- emissione movimento carrelli
EMT.AUXCMD = {}
if #EMT.MDCHAR > 0 then
EmtOutput( '(ROTATION)')
end
for i = 1, #EMT.MDCHAR do
EmitMoveDataChars( EMT.MDCHAR[i])
end
if #EMT.MDCHAR > 0 then
EmitMoveStartChars( 1)
EmitMoveStartChars( 2)
end
EMT.MDCHAR = {}
EMT.AUXTYPE = nil
-- se rotazioni diverse, emetto il comando e aggiorno lo stato
if VerifyEmitRotation() then
-- imposto stato post-rotazione
EMT.POSTROT = true
-- imposto recupero sovramateriale in X non più presente
EMT.X_OFF = EMT.HOVM
end
-- altrimenti disposizione finale, eventuale scarico pezzo lavorato se non ci sono lavorazioni
else
else
if #EMT.MDCHAR > 0 then
MyOutputNoNum( '(PART UNLOAD)')
for i = 1, #EMT.MDCHAR do
@@ -1108,7 +1128,7 @@ function OnRapid()
end
EMT.MDCHAR = {}
-- se necessario allargo le cabine
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or
if RollerParkingNeeded( EMT.HEAD, PrevR1, PrevR2, EMT.R1, EMT.R2) or EMT.TOOL ~= EMT.PREVTOOL or
EMT.V1POS < EMT.V1NEXTPOS - 1 or EMT.V2POS > EMT.V2NEXTPOS + 1 then
local dPosT = EMT.TPOS or EMT.L1op
EmitParkRoller( dPosT, EMT.MCHSPLIT)
@@ -1427,7 +1447,8 @@ function OnRapid()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
local CurrL3o = EMT.L3o
EMT.L3o = EMT.L3op
EmitZmax( true, true, bToXhome, EMT.R1p, EMT.R2p, EMT.MCHSPLIT)
@@ -2148,9 +2169,10 @@ function PreparePostRotation( sCmd, nInd)
elseif Cmd[1] == '2' then
if Cmd[2] == 'Y1' then
-- tolgo eventuale sovramateriale presente sul pezzo in posizione iniziale (la misura laser è ora col finito)
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, FinStatY1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=1}
local MDChar = { Y1=tonumber(Cmd[3])-EMT.HOVM, IniStatY1=75, V1=ParkV1, V2=ParkV2, FinStatY1=-1, BeamVise=0, Aux=' (E80058=0)', MovType=1}
table.insert( EMT.MDCHAR, MDChar)
EMT.V1POS = ParkV1
EMT.V2POS = ParkV2
elseif Cmd[2] == 'T' then
local MDChar = { Y1=tonumber(Cmd[3]), IniStatY1=76, FinStatY1=EMT.FSY1, BeamVise=0, MovType=1}
table.insert( EMT.MDCHAR, MDChar)
@@ -2444,6 +2466,48 @@ function GetSpecUnloading( nPathId)
return ( sVal == '0,Unloading SpecSplit')
end
---------------------------------------------------------------------
function VerifyEmitRotation()
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- se sono uguali non devo fare alcunchè
if nRot == nPrevRot then
return false
end
-- se ho la testa 2, quindi tipo PF
if EgtGetHeadId( 'H21') then
local nDeltaRot = nRot - nPrevRot
-- rotazione automatica o manuale (sempre con il medesimo comando)
local sOut = 'M180 L0=' .. tostring( nDeltaRot)
EmtOutput( sOut)
-- altrimenti se ONE
else
if nRot > nPrevRot then nRot = nRot - 4 end
local nDeltaRot = nRot - nPrevRot
-- se rotazione automatica richiesta e possibile
local dRefLen = EgtIf( IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE), EMT.LT, EMT.LB)
-- se rotazione automatica richiesta e possibile
if AutomaticRotation and dRefLen >= AutoRotMinLen then
local sOut = 'M180 L0=' .. tostring( -nDeltaRot)
EmtOutput( sOut)
else
local sOut
if nDeltaRot == -1 then
sOut = 'M151'
elseif nDeltaRot == -2 then
sOut = 'M152'
elseif nDeltaRot == -3 then
sOut = 'M153'
end
EmtOutput( sOut)
EmtOutput( 'M86')
EmtOutput( 'G4F.5')
end
end
return true
end
---------------------------------------------------------------------
function EmitZmax( bReset, bEnd, bXhome, PrevR1, PrevR2, bSplitCut, bUsePrevDelta)
if bReset then
@@ -2668,7 +2732,10 @@ end
---------------------------------------------------------------------
function EmitResetMachining()
if ( EMT.TOOL ~= GetNextTool( EMT.MCHID) and IsLastPath( EMT.PATHID)) or GetSpecUnloading( EMT.PATHID) or GetFall( EMT.PATHID) then
EmtOutput( 'M05')
-- se da MLDE parametro non settato, o settato a true, scrivo il comando arresto mandrino
if WriteM05Command == nil or WriteM05Command then
EmtOutput( 'M05')
end
end
local sOut = 'G157 EA1'
EmtOutput( sOut)
@@ -2762,28 +2829,6 @@ function EmitParkRoller( dPosT, bSplitCut, bUsePrevDelta)
EMT.TPOS = dPosT
end
---------------------------------------------------------------------
function GetNextTool( nMchId)
-- inizializzo prossimo utensile
local sNextTool
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
end
-- se trovata
if nNextMchId and EgtSetCurrMachining( nNextMchId) then
sNextTool = EgtGetMachiningParam( MCH_MP.TOOL)
end
-- ripristino stato corrente
EgtSetCurrMachining( EMT.MCHID)
EgtTdbSetCurrTool( EMT.TOOL)
return sNextTool
end
---------------------------------------------------------------------
function PreselectNextDiffHead( nMchId, sHead)
-- se non ho due teste, esco subito
+106 -41
View File
@@ -359,7 +359,6 @@ function OnSimulDispositionStart()
if EMT.VMILL and #EMT.VMILL > 0 then
EgtSetStatus( EMT.SCRAP or GDB_ID.NULL, GDB_ST.OFF)
end
-- se altrimenti fasi intermedia o finale speciali, aggancio primo grezzo alla tavola e gli altri in posizione pre-carico
elseif IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se cambiata giacitura, lo segnalo
@@ -454,6 +453,21 @@ function OnSimulDispositionEnd()
EMT.FALL = false
EMT.TO_FALL = false
end
-- se disposizione intermedia
if IsMidPhase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
-- se altrimenti disposizione intermedia speciale con eventuale rotazione
elseif IsMid2Phase( EMT.PHASE) then
-- se le rotazioni delle fasi corrente e precedente sono diverse
if GetPhaseRot( EMT.PHASE) ~= GetPhaseRot( EMT.PHASE - 1) then
-- imposto stato post-rotazione
EMT.POSTROT = true
end
end
EMT.SPLIT = false
EMT.SPECSPLIT = false
EMT.TO_SPECSPLIT = false
@@ -494,6 +508,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C1', MyParkCSawC1)
EgtSetAxisPos( 'B1', ParkCSawB1)
EgtSetAxisPos( 'X1', ParkCSawX1)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H1 = EMT.HEAD
else
-- imposto home dell'asse C2 (A=0 -> T111, A=-90 -> T112)
local MyParkCSawC2 = GetChainSawCHomeFromVirtualAxis( dPosA)
@@ -501,6 +517,8 @@ function OnSimulToolSelect( dPosA)
EgtSetAxisPos( 'C2', MyParkCSawC2)
EgtSetAxisPos( 'B2', ParkCSawB2)
EgtSetAxisPos( 'X2', ParkCSawX2)
-- l'utensile viene caricato qui, quindi setto come già cambiato
EMT.PREVHEAD_H2 = EMT.HEAD
end
-- Imposto visualizzazione
EgtSetMode( EgtGetHeadId( EMT.HEAD) or GDB_ID.NULL, GDB_MD.STD)
@@ -638,10 +656,10 @@ function OnSimulToolDeselect( dPrevA)
-- se devo scaricare un utensile normale
else
local nSetHead = GetHeadSet( EMT.HEAD)
if nSetHead == 1 then
if nSetHead == 1 and EMT.PREVHEAD_H1 then
local MyParkX1 = EgtIf( GetHeadTCSet( EMT.HEAD, EMT.TCPOS) == 'Head1_TC1', ParkX1, ParkFrnX1)
SimulMoveAxis( 'X1', MyParkX1, MCH_SIM_STEP.RAPID)
else
elseif EMT.PREVHEAD_H2 then
SimulMoveAxis( 'X2', ParkX2, MCH_SIM_STEP.RAPID)
end
end
@@ -727,17 +745,6 @@ function OnSimulMachiningStart()
end
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
-- recupero alcuni dati della lavorazione
EMT.MCHNAME = EgtGetOperationName( EMT.MCHID)
EMT.MCHTYPE = EgtGetMachiningParam( MCH_MP.TYPE)
@@ -813,6 +820,23 @@ function OnSimulMachiningEnd()
if EMT.DOU_TYPE and not EMT.ZMAX then EMT.DOU_TO_ZMAX = true end
EMT.DOU_TYPE = nil
EMT.DOU_TOOL = nil
-- salvo dati utensile
local nSetHead = GetHeadSet( EMT.HEAD)
-- se non ho già tolto la sega a catena, aggiorno valori
if not EMT.CHSAW_OUT then
-- per gruppo testa 1
if nSetHead == 1 then
EMT.PREVTOOL_H1 = EMT.TOOL
EMT.PREVHEAD_H1 = EMT.HEAD
EMT.PREVTCPOS_H1 = EMT.TCPOS
-- per gruppo testa 2
elseif nSetHead == 2 then
EMT.PREVTOOL_H2 = EMT.TOOL
EMT.PREVHEAD_H2 = EMT.HEAD
EMT.PREVTCPOS_H2 = EMT.TCPOS
end
end
end
---------------------------------------------------------------------
@@ -838,7 +862,7 @@ end
---------------------------------------------------------------------
function OnSimulPathEnd()
-- rimozione sfridi
RemoveScraps()
ExecRemoveScraps()
-- se non ci sono comandi ausiliari associati e richiesta risalita a Zmax
if EMT.AUXTOT == 0 and EMT.TO_ZMAX then
if EMT.MCHSPLIT and not EMT.TO_FALL and not EMT.TO_SPECSPLIT then
@@ -911,7 +935,8 @@ function OnSimulMoveStart()
local bParkV = false
if EMT.MCHFIRST then
-- se rulli più chiusi del richiesto o cambio direzione utensile (tranne solo asse B con C0 o equivalenti) devo mettere i rulli in parcheggio
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) then
if V1Pos < EMT.V1NEXTPOS - 1 or V2Pos > EMT.V2NEXTPOS + 1 or RollerParkingNeeded( EMT.HEAD, EMT.R1p, EMT.R2p, EMT.R1, EMT.R2) or
( EMT.TOOL ~= EMT.PREVTOOL_H1 and EMT.TOOL ~= EMT.PREVTOOL_H2) then
bParkV = true
EMT.A3 = ParkV1
EMT.A4 = ParkV2
@@ -1089,6 +1114,23 @@ function OnSimulMoveStart()
end
-- altrimenti sega a catena
else
-- se anche precedente con sega a catena ma depositata, devo riprenderla
if EMT.CHSAW_OUT then
local dPosA = GetCurrChainSawingVirtualAxis()
EgtSetMode( EgtGetHeadId( EMT.HEAD), GDB_MD.HIDDEN)
OnSimulToolDeselect()
EgtLoadTool( EMT.HEAD, 1, EMT.TOOL)
ShowToolInTcPos( EMT.TCPOS, false)
OnSimulToolSelect( dPosA)
-- recupero i dati dato che ho scaricato motosega e preso quelli dell'utensile di default
EmtModifyAxisHome( 'Z2', GetChainSawZHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'C2', GetChainSawCHomeFromVirtualAxis( dPosA))
EmtModifyAxisHome( 'B2', ParkCSawB2)
B2Home = EgtGetAxisHomePos( 'B2')
C2Home = EgtGetAxisHomePos( 'C2')
Z2Home = EgtGetAxisHomePos( 'Z2')
EMT.CHSAW_OUT = nil
end
-- se motosega configurata per lavorazioni di fianco o circa orizzontale
if dPosA == 0 or abs( EMT.R2) < 10 then
SimulMoveAxes( 'X2', EMT.L2, MCH_SIM_STEP.RAPID, 'C2', EMT.R1, MCH_SIM_STEP.COLLROT)
@@ -1171,6 +1213,11 @@ end
---------------------------------------------------------------------
function OnSimulMoveEnd()
-- rimozione eventuali sfridi
if EMT.FLAG == 301 then
ExecRemoveScraps()
end
-- se primo rapido della lavorazione
if EMT.MCHFIRST and EMT.MOVE == 0 then
-- se lavorazione split, dichiaro carro Y1 riagganciato
@@ -1212,11 +1259,12 @@ function OnSimulMoveEnd()
-- se Zmax dopo fine lavorazione
if EMT.MOVE == 0 and EMT.FLAG == 3 then
-- eventuale rimozione sfridi
RemoveScraps()
ExecRemoveScraps()
-- se Split o Presplit lascio agganciata solo la pinza Y2 alla fine dei movimenti
local sNextTool = GetNextTool( EMT.MCHID)
-- vado in home se è ultimo movimento ed è ultima lavorazione, se sono con motosega e devo cambiare utensile, oppure se ho la lama
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or EMT.HEAD == 'H12' or EMT.HEAD == 'H22'
local bToXhome = ( IsLastPath( EMT.PATHID) and not sNextTool) or ( EMT.HEAD == 'H23' and EMT.TOOL ~= sNextTool) or ( EMT.HEAD == 'H13' and EMT.TOOL ~= sNextTool) or
( EMT.HEAD == 'H12' and EMT.TOOL ~= sNextTool ) or ( EMT.HEAD == 'H22' and EMT.TOOL ~= sNextTool) or EMT.MCHSPLIT
-- eseguo
ExecMoveZmax( EMT.MCHSPLIT, bToXhome)
EMT.TO_ZMAX = nil
@@ -1552,6 +1600,14 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'Z1', ParkCSawZ1, MCH_SIM_STEP.RAPID, 'B1', ParkB1, MCH_SIM_STEP.COLLROT)
end
if btoXHome then
EgtUnloadTool( EMT.HEAD, 1)
ShowToolInTcPos( EMT.TCPOS, true)
EMT.PREVTOOL_H1 = nil
EMT.PREVHEAD_H1 = nil
EMT.PREVTCPOS_H1 = nil
EMT.CHSAW_OUT = true
end
SimulMoveAxes( 'X1', HomeX, MCH_SIM_STEP.RAPID, 'C1', HomeC, MCH_SIM_STEP.COLLROT)
end
@@ -1579,7 +1635,7 @@ function ExecMoveZmax( bMchSplit, btoXHome)
if EMT.SB > 650 and abs( EMT.R3) < 0.1 then
SimulMoveAxes( 'Z2', ParkCSawZ2, MCH_SIM_STEP.RAPID, 'B2', ParkB2, MCH_SIM_STEP.COLLROT)
end
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
SimulMoveAxes( 'X2', HomeX, MCH_SIM_STEP.RAPID, 'C2', HomeC, MCH_SIM_STEP.COLLROT)
end
end
EMT.ZMAX = true
@@ -1614,10 +1670,14 @@ function ExecUnloading()
EgtMove( nLayId, vtMove, GDB_RT.GLOB)
EgtSetLevel( vMillId, GDB_LV.USER)
-- aggiungo gli spigoli
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
if EgtVolZmapSetShowEdges then
EgtVolZmapSetShowEdges( vMillId, true)
else
local nFirstId, nCount = EgtVolZmapGetEdges( vMillId, nLayId)
if nFirstId then
for nId = nFirstId, nFirstId + nCount - 1 do
EgtSetColor( nId, Color3d( 96, 96, 96))
end
end
end
-- rilascio Vmill
@@ -1819,7 +1879,7 @@ function ExecOpenRoller( nInd)
end
---------------------------------------------------------------------
function RemoveScraps()
function ExecRemoveScraps()
-- se attivo VMILL, lavorazione ed è richiesto di eliminare gli sfridi
if EMT.VMILL and #EMT.VMILL > 0 and not EMT.OPEISDISP and EMT.VMRS then
local vMillId = EMT.VMILL[1]
@@ -1850,7 +1910,6 @@ function RemoveScraps()
end
EMT.VMRS = false
end
end
---------------------------------------------------------------------
@@ -2115,18 +2174,19 @@ end
---------------------------------------------------------------------
-- *** ESTIMATION T&L ***
---------------------------------------------------------------------
local RAPID_X_FEED = 70000 -- mm/min
local RAPID_Y_FEED = 100000 -- mm/min
local RAPID_Z_FEED = 32000 -- mm/min
local RAPID_C_FEED = 15000 -- deg/min
local RAPID_B_FEED = 15000 -- deg/min
local RAPID_MIN_T = 0.1 -- s
local LOAD_T = 2 -- s
local CHAR_ONE_MOVE_T = 1 -- s
local ROTATION_T = 40 -- s
local SPLIT_T = 6 -- s
local UNLOAD_T = 4 -- s
local FALL_T = 2 -- s
local ESTIMATION_RAPID_COEFF = EstimationRapidMultiplier or 1
local RAPID_X_FEED = 70000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Y_FEED = 100000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_Z_FEED = 32000 / ESTIMATION_RAPID_COEFF -- mm/min
local RAPID_C_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_B_FEED = 15000 / ESTIMATION_RAPID_COEFF -- deg/min
local RAPID_MIN_T = 0.1 * ESTIMATION_RAPID_COEFF -- s
local LOAD_T = 2 * ESTIMATION_RAPID_COEFF -- s
local CHAR_ONE_MOVE_T = 1 * ESTIMATION_RAPID_COEFF -- s
local ROTATION_T = 40 * ESTIMATION_RAPID_COEFF -- s
local SPLIT_T = 6 * ESTIMATION_RAPID_COEFF -- s
local UNLOAD_T = 4 * ESTIMATION_RAPID_COEFF -- s
local FALL_T = 2 * ESTIMATION_RAPID_COEFF -- s
---------------------------------------------------------------------
function OnEstimStart()
@@ -2192,9 +2252,9 @@ function OnEstimDispositionEnd()
-- Se disposizione inizio o rimanenza
if IsStartOrRestPhase( EMT.PHASE) then
;
-- se altrimenti disposizione intermedia, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
-- se altrimenti disposizione intermedia o finale dopo separazione e rotazione, eventuale rotazione
elseif IsMidPhase( EMT.PHASE) or IsMid2Phase( EMT.PHASE) or IsEnd2Phase( EMT.PHASE) then
-- recupero le rotazioni delle fasi corrente e precedente
local nRot = GetPhaseRot( EMT.PHASE)
local nPrevRot = GetPhaseRot( EMT.PHASE - 1)
-- verifico se sono diverse
@@ -2650,7 +2710,12 @@ function GetNextTool( nMchId)
-- recupero lavorazione successiva
local nNextMchId = EgtGetNextActiveOperation( nMchId)
while nNextMchId do
if EgtGetOperationType( nNextMchId) ~= MCH_OY.DISP then
-- se la prossima lavorazione è lo start di un altro pezzo, faccio finta che cambia utensile in modo che vada in parcheggio con utensili speciali
if EgtGetOperationType( nNextMchId) == MCH_OY.DISP then
if IsStartOrRestPhase( EMT.PHASE+1) then
return nil
end
else
break
end
nNextMchId = EgtGetNextActiveOperation( nNextMchId)
+14 -5
View File
@@ -1116,8 +1116,12 @@ function SpecialCalcMachiningEncumbrance( nMchId, bPreCut)
end
b3Enc = EgtGetBBoxGlob( EgtGetAxisId( 'C2'), GDB_BB.ONLY_VISIBLE)
end
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + SIC_V
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + SIC_V
-- Forzo la distanza di sicurezza da utensile
local nSecRollerDist = EgtGetValInNotes( EgtTdbGetCurrToolParam( MCH_TP.USERNOTES), 'SECDIST', 'i') or SIC_V
local dRollFront = max( b3Enc:getMax():getX(), MIN_FRONT_ENG_V) + nSecRollerDist
local dRollBack = max( -b3Enc:getMin():getX(), MIN_BACK_ENG_V) + nSecRollerDist
EgtOutLog( ' RollFront = ' .. EgtNumToString( dRollFront, 1) .. ' RollBack = ' .. EgtNumToString( dRollBack, 1), 3)
-- Calcolo della posizione della Punta Utensile rispetto allo Zero Macchina
local ptTip
@@ -1652,19 +1656,24 @@ function SpecAdjustCarriages( WorkTab)
local bCloseV = false
if WorkTab.dY1DeltaI then
if WorkTab.dY1DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EMC.HCING + EMC.HOVM + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaI then
if EMC.LB - WorkTab.dY2DeltaI <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
if WorkTab.dY2DeltaMinF then
if EMC.LB - WorkTab.dY2DeltaMinF <= MinJoin + WorkTab.dV1PosI - WorkTab.dV2PosI + 2 * AGG_V + EgtIf( SPLIT, EMC.TCING, 0) + EgtIf( EMC.CNT == 1, AggLoad, 0) then
bCloseV = true
bCloseV = true
end
end
-- se i pezzi del cliente sono molto storti, si forza la chiusura per evitare che vada a sbattere. Se parametro non presente, si chiude solo se necessario
if ForceToCloseRollersGate then
bCloseV = true
end
WorkTab.bCloseV = bCloseV
EgtOutLog( ' Tool : '..( EgtIf( bChangedTool, 'CHANGED', 'same')).. ' CloseV : '..( EgtIf( bCloseV, 'TRUE', 'false')), 1)
+3 -3
View File
@@ -25,9 +25,9 @@ REM copio i sorgenti nel percorso temporaneo per i compilati
ROBOCOPY . %fullPathSource%\bin\%machineName%\ /E /XF "Compile.bat" /XF ".gitignore" /XD ".git" /XF "UpdateLog.txt"
REM copio i file compilati nel percorso temporaneo per i compilati
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.mlpe Common-PF1250.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.mlse Common-PF1250.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.NUM.mlpe Common-PF1250.TPA.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.mlpe -s Common_ONE-PF.mlpe
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.mlse -s Common_ONE-PF.mlse
\EgtProg\Dll32\luac54 -o %fullPathSource%\bin\%machineName%\Common_ONE-PF.NUM.mlpe -s Common_ONE-PF.NUM.mlpe
REM comprimo i file compilati in uno zip pronto per essere distribuito
tar.exe acvf %fullPathZip%\%machineName%.zip -C %fullPathSource%\bin\ %machineName%\*.*
+19 -8
View File
@@ -42,13 +42,25 @@
-- 2024/02/07 ver 2.6a5 Allineamento con Common ver. 2.6a6
-- 2024/02/19 ver 2.6b1 In BeamData aggiunta funzione GetBlockedAxis che sostituisce la GetChainSawBlockedAxis.
-- 2024/02/23 ver 2.6b2 Allineamento con common ver. 2.6b2; in mlde aggiunte chiamate EgtAddToPackagePath
-- 2024/02/29 ver 2.6c1 Allineamento con common ver. 2.6c1
-- 2024/03/04 ver 2.6c2 Modificato log con nome macchina
-- Allineamento con common ver. 2.6c2
-- 2024/03/06 ver 2.6c3 Allineamento con common ver. 2.6c4
-- 2024/03/06 ver 2.6c4 Allineamento con common ver. 2.6c5
-- 2024/03/08 ver 2.6c5 Allineamento con common ver. 2.6c6
-- 2024/03/11 ver 2.6c6 Allineamento con common ver. 2.6c7
-- 2024/03/26 ver 2.6c7 Con aggregati, non viene più aggiunto il gruippo SOLID (in MLDE)
-- 2024/03/28 ver 2.6d1 Allineamento con common ver. 2.6d1
-- 2024/04/12 ver 2.6d2 Allineamento con common ver. 2.6d2
-- Aggiunto parametro ForceToCloseRollersGate
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '2.6b2'
PP_VER = '2.6d2'
MIN_MACH_VER = '2.5k1'
MACH_NAME = 'Essetre-ONE'
-- Carico i dati globali
local sMachDir = EgtGetCurrMachineDir()
@@ -62,7 +74,7 @@ if INFO_STD_PP.MIN_MACH_VER_PP_COMMON > MIN_MACH_VER then
MIN_MACH_VER = INFO_STD_PP.MIN_MACH_VER_PP_COMMON
end
EgtOutLog ( '**PP_VER ver.'..PP_VER..'**'..INFO_STD_PP.NAME..' ver.'..INFO_STD_PP.VERSION, 1)
EgtOutLog ( '** ' .. MACH_NAME..' '..PP_VER..' ** ( '..INFO_STD_PP.NAME..': '..INFO_STD_PP.VERSION..' - MinMach: '.. MIN_MACH_VER ..') **', 1)
-- Parametri macchina
NumericalControl = 'NUM' -- NUM o TPA o NUM_FLEX
@@ -149,6 +161,7 @@ AutomaticRotation = true
AutoRotMinLen = 0
DefTcPos1 = 'T3'
CoeffVM = 0.5
ForceToCloseRollersGate = false
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-ONE.data"
@@ -212,6 +225,7 @@ if EgtExistsFile( sData) then
if Machine.Offsets.SAWOFFSX then SawOffsX = Machine.Offsets.SAWOFFSX end
if Machine.Offsets.SAWOFFSZ then SawOffsZ = Machine.Offsets.SAWOFFSZ end
if Machine.Offsets.DEFTCPOS1 then DefTcPos1 = ( 'T' .. Machine.Offsets.DEFTCPOS1) end
if Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO then ForceToCloseRollersGate = Machine.Offsets.CHIUDI_PINZE_2_3_SCAMBIO == 1 end
-- aggiustamenti
MinY1 = MinV1 + MinDeltaYV
MaxY1 = MaxMchY1
@@ -351,8 +365,7 @@ if Progress then
Rot2Stroke = { -90.1, 90.1},
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H15_HEAD/GEO',
Aux = 'H15_HEAD/SOLID'}
Geo = 'H15_HEAD/GEO'}
else
H13Id = EmtHead {
Name = 'H13',
@@ -366,8 +379,7 @@ else
Rot2Stroke = { -90.1, 90.1},
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H13_HEAD/GEO',
Aux = 'H13_HEAD/SOLID'}
Geo = 'H13_HEAD/GEO'}
end
EgtSetInfo( H13Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H13Id, 'ZMAXONROT', '1,80')
@@ -386,8 +398,7 @@ if not Progress and Mortiser then
Rot2Stroke = { -90.1, 90.1},
SolCh = MCH_SCC.ADIR_NEAR,
OthColl = {'B1/SOLID', 'C1/SOLID'},
Geo = 'H15_HEAD/GEO',
Aux = 'H15_HEAD/SOLID'}
Geo = 'H15_HEAD/GEO'}
EgtSetInfo( H15Id, 'ZSAFEDELTA', '60')
EgtSetInfo( H15Id, 'ZMAXONROT', '1,80')
end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+48 -7
View File
@@ -1,29 +1,70 @@
==== Essetre_StdPF Update Log ====
==== Common_ONE-PF Update Log ====
versione 2.6b2 (26/02/2024)
Versione 2.6d2 (12/04/2024)
- (MLDE-SIM-GEN) Aggiunta variabile FACOLTATIVA 'ForceToCloseRollersGate' ( che legge la variabile da TS3 'CHIUDI_RULLI_SCAMBIO') in mlde per forzare chiusura paratie rulli
durante scambio pinze per facilitare passaggio pezzi molto storti. Se non presente chiude solo se necessario.
Versione 2.6d1 (28/03/2024)
- (GEN) Rimosso da generazione funzione GetNextTool duplicata
- (SIM-GEN) Se fase successiva start di un altro pezzo, la GetNextTool restituisce nil, per forzare movimento home in caso di utensili speciali
- (MLDE-GEN) Aggiunto parametro 'IS_TEST_MACHINE' FACOLTATIVO. Se non esiste o 'false' è macchina standard, se 'true' è una macchina utilizzata per i test Egalware interni
- (SIM) Corretto movimento in simulazione se motosega su testa 2
Versione 2.6c9 (26/03/2024)
- (SIM) Corretta gestione cambio utensile con motosega. In alcuni casi non era coerente con generazione
- (GEN) In 'PreparePostRotation' si resetta sempre anche la paratia in uscita (Ticket#1733)
Versione 2.6c8 (22/03/2024)
- (SIM) Miglioramento visualizzazione spigoli VMILL alla fine della simulazione. Funzione: EgtVolZmapSetShowEdges. CAM5 ver. 2.6c2 FACOLTATIVA.
Versione 2.6c7 (11/03/2024)
- (SIM-GEN) Aggiunta gestione parametro "SECDIST". Distanza di sicurezza tra paratia con rulli e utensile/testa. Parametro da inserire nelle note utensile.
- (MLPE-GEN) Aggiunto parametro "WriteM05Command" (NON OBBLIGATORIO) per decidere se scrivere il comando M05 per arresto mandrino. Default a true.
Versione 2.6c6 (08/03/2024)
- (SIM-GEN) Gestione rotazioni 90° come su FAST, caso MID2 (split/cut prima delle rotazioni)
Versione 2.6c5 (07/03/2024)
- (GEN) Per ribaltamento, i comandi si differenziano per macchina. Sembra che ONE e PF abbiano comandi diversi. In attesa di conferma da parte di Essetre
- (SIM-GEN) Se cambiato utensile, si aprono sempre paratie
- (SIM) Spostato salvataggio dati utensile precedente in MachiningEnd, prima era in MachininsStart
Versione 2.6c4 (06/03/2024)
- (SIM-GEN) Alla fine del movimento a Z-MAX, in home con lama solo se si cambia utensile. Prima andava sempre in home se era lama, anche se non doveva cambiare utensile
Versione 2.6c3 (05/03/2024)
- (MLDE-SIM) Aggiunta variabile FACOLTATIVA 'EstimationRapidMultiplier' in mlde per regolare il tempo stimato di rapido su macchine vecchie. Se non presente default 1.
Versione 2.6c2 (04/03/2024)
- (MLDE-GEN) Aggiunta variabile 'MACH_NAME' in mlde con nome macchina
Versione 2.6c1 (29/02/2024)
- (SIM) Gestione rimozione VMILL per tagli a cubetti Zig-Zag
Versione 2.6b2 (26/02/2024)
- (MLDE-SIM-GEN) EgtAddToPackagePath spostato in mlde
versione 2.6b1 (20/02/2024)
Versione 2.6b1 (20/02/2024)
- (SIM) Corretto controllo calcolo Z su primo movimento lama, allineato a generazione
- (GEN) Corretto emissione movimenti per macchine con motosega su testa 2
- (SIM) Aggiunta funzioni "OnSimulInit" e "OnSimulExit" per orientare vista corretta in caso di macchina con carico destro. N.B.= serve CAM5 2.6b4
- (ALL) "BeamData" caricato come libreria con 'require' anziché come file con 'dofile'
- (GEN) In "GetMovesInAuxCmd" si passa la posizione calcolata V1 indipendentemente dall'utilizzo di Y1
versione 2.6a7 (12/02/2024)
Versione 2.6a7 (12/02/2024)
- (GEN) Per movimento con motosega, si ribadiscono tutti gli assi nella prima G141
versione 2.6a6 (02/02/2024)
Versione 2.6a6 (02/02/2024)
- (SIM) Corretta simulazione movimento in X-Home, coerente con generazione
- (GEN) Aggiunta lettura parametro 'Split'
- (SIM) Se lavorazione è un taglio di separazione, se necessario, ripristino posizione di Y1DELTA prima di aprire i rulli
- (SIM-GEN) Modificata gestione movimenti motosega, in aggiunta con caso particolare di pezzo alto più di 650mm
- (ALL) Caricamento BeamData come local
versione 2.6a5 (26/01/2024)
Versione 2.6a5 (26/01/2024)
- (SIM-GEN) Migliorato calcolo dimensioni grezzo per apertura rulli in caso di 'precut'
versione 2.6a4 (24/01/2024)
Versione 2.6a4 (24/01/2024)
- (GEN) Se pezzo tenuto solo con pinza destra non si esclude la rulliera di sinistra, se pezzogrande, può venire in supporto
- (SIM-GEN) Correzione gestione apertura/chiusura rulli sul fine barra e in generale (da PF1250)
- (SIM) Aggiunto solido collisione lama sotto traversa (per PF-progress)
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_ONE-PF', -- nome script PP standard
VERSION = '2.6b2', -- versione script
VERSION = '2.6d2', -- versione script
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
}