Compare commits

...

9 Commits

Author SHA1 Message Date
andrea.villa 11c3e0c3e5 Allineamento a common ver.3.1b1 2026-02-20 16:29:23 +01:00
luca.mazzoleni a7824bf0c8 - in mlde ParkCSawX1 portata a 1700 2026-02-20 16:14:39 +01:00
daniele.nicoli 0f036d5be5 Se attivo scarico al carico, ma il pezzo non soddisfa le condizioni restituisce errore e non permette la generazione. 2026-02-16 15:21:16 +01:00
andrea.villa d14c84da8f Piccole correzioni in generazione 2026-02-13 16:49:48 +01:00
andrea.villa 95b10fdfe6 - Corretto extra-corsa allo scarico
- Corretti doppi movimenti a ZMAX
- Apertura paratie sull'ultimo comando di home pinza 1
2026-02-13 16:32:32 +01:00
andrea.villa 4f43b42149 - Corretta gestione Movimento in Z sicurezza per chiusura pinze
- Se scarico al carico, alla fine si manda in parcheggio rulliera lato scarico
- Cambio versione per rilascio a cliente
2026-02-13 10:27:28 +01:00
andrea.villa e6e0c3118e Cambio versione per rilascio a cliente 2026-02-13 08:21:16 +01:00
andrea.villa b1103550fa UnloadOnLoadPos trasformata da globale a locale 2026-02-13 08:20:54 +01:00
andrea.villa 9be7a2c081 Scarico al carico se viene settato valore 1 o -1 2026-02-12 15:45:58 +01:00
5 changed files with 100 additions and 26 deletions
+45 -7
View File
@@ -32,6 +32,10 @@ function OnStart()
EMT.MAXACC = MaxAcc or 6000 -- accelerazione massima pinze. In realtà è il tempo in millisecondi, quindi MAXACC corrisponde al tempo massimo per raggiungere la velocità desiderata
EMT.MINACC = MinAcc or 600 -- accelerazione minima pinze. In realtà è il tempo in millisecondi, quindi MINACC corrisponde al tempo massimo per raggiungere la velocità desiderata
SetToParkLine() -- si inizia con linee da parcheggiare su stack
-- se il pezzo dev'essere scaricato al carico
local dUnloadType = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'UNLOAD', 'd')
EMT.UNLOAD = dUnloadType == 1 or dUnloadType == -1
end
---------------------------------------------------------------------
@@ -289,7 +293,7 @@ function OnDispositionEnd()
-- altrimenti disposizione finale, eventuale scarico pezzo lavorato se non ci sono lavorazioni
else
if #EMT.MDCHAR > 0 then
if EMT.AUXTYPE == 'R' and UnloadOnLoadPos then
if EMT.AUXTYPE == 'R' and EMT.UNLOAD then
EmitRemark( 'PART UNLOAD ON LOAD POSITION')
else
EmitRemark( 'PART UNLOAD')
@@ -320,7 +324,7 @@ function OnDispositionEnd()
local sEnd= 'M113 P1='..tostring( EMT.PRODID)..' P2='..tostring( EMT.PATTID)..' P3='..tostring( EMT.CUTID)..' P4=2'
MyOutput( sEnd)
end
if UnloadOnLoadPos then
if EMT.UNLOAD then
MyOutput('M77')
end
end
@@ -516,9 +520,11 @@ function OnMachiningEnd()
EMT.TO_ZMAX = nil
end
EmitRemark( 'PART FALL')
elseif UnloadOnLoadPos and not nNextPathId and not nNextMchId then
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
EMT.ZMAX = true
elseif EMT.UNLOAD and not nNextPathId and not nNextMchId then
if not EMT.ZMAX then
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
EMT.ZMAX = true
end
EmitRemark( 'PART UNLOAD ON LOAD POSITION')
else
EmitZmax( false, true, EMT.R1, EMT.R2, false, false, false)
@@ -599,6 +605,9 @@ end
---------------------------------------------------------------------
function OnPathStart()
if EMT.OPEISDISP then
return
end
-- non ancora iniziata la lavorazione
EMT.MCHFIRST = true
EMT.MCHFIRSTFEED = true
@@ -628,6 +637,9 @@ end
---------------------------------------------------------------------
function OnPathEnd()
if EMT.OPEISDISP then
return
end
if not EMT.ZMAX then
EmitResetMachining()
end
@@ -1980,6 +1992,10 @@ function PrepareResidue( sCmd, nInd)
else
EMT.UNL = true
end
-- se è scarico al carico
if Cmd[2] == 'Unload-On-Load' then
EMT.UNL2 = true
end
elseif Cmd[1] == '1' then
if Cmd[2] ~= 'Z' then
local MDChar
@@ -1993,6 +2009,11 @@ function PrepareResidue( sCmd, nInd)
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
EMT.ROLL_IN = nil
end
-- se scarico al carico parcheggio per sicurezza morsa e paratia lato scarico
if EMT.UNL2 then
MDChar.V1 = ParkV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = ParkV2 ; EMT.V2POS = MDChar.V2
end
table.insert( EMT.MDCHAR, MDChar)
end
elseif Cmd[1] == '2' then
@@ -2157,27 +2178,44 @@ function PreparePreRotation( sCmd, nInd)
EMT.PREROT = true
elseif Cmd[2] == 'SplitRot' then
EMT.SPLITROT = true
-- se è scarico al carico
elseif Cmd[2] == 'Unload-On-Load' then
EMT.UNL2 = true
end
elseif Cmd[1] == '1' then
if Cmd[2] ~= 'Z' then
local MDChar
if not EMT.PREROT then
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
if EMT.UNL2 then
MDChar.V1 = ParkV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = ParkV2 ; EMT.V2POS = MDChar.V2
end
else
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, IniStatY2=1, BeamVise=0}
end
table.insert( EMT.MDCHAR, MDChar)
end
elseif Cmd[1] == '2' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV2=1, BeamVise=EMT.BV}
if Cmd[2] ~= 'T' then MDChar[Cmd[2]] = tonumber( Cmd[3]) end
if Cmd[4] ~= 'T' then MDChar[Cmd[4]] = tonumber( Cmd[5]) end
if EMT.ROLL_IN then
MDChar.V1 = MinV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
elseif Cmd[1] == '3' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, BeamVise=EMT.BV}
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV1=1, IniStatV2=1, BeamVise=EMT.BV}
if Cmd[2] ~= 'T' then MDChar[Cmd[2]] = tonumber( Cmd[3]) end
if Cmd[4] ~= 'T' then MDChar[Cmd[4]] = tonumber( Cmd[5]) end
if Cmd[6] ~= 'T' then MDChar[Cmd[6]] = tonumber( Cmd[7]) end
if EMT.ROLL_IN then
MDChar.V1 = MinV1 ; EMT.V1POS = MDChar.V1
MDChar.V2 = MaxV2 ; EMT.V2POS = MDChar.V2
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
elseif Cmd[1] == '4' then
EMT.TO_ZMAX = true
+49 -15
View File
@@ -276,7 +276,6 @@ local DIST_Y1MAX_LOAD = 100 -- distanza carrello Y1 da massimo asse al ca
----------------------- Variabili -----------------------------------
local Test = false
local SPLIT
UnloadOnLoadPos = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo'), 'UNLOAD', 'b') == 1 -- se il pezzo dev'essere scaricato al carico
---------------------------------------------------------------------
local function PrepareClGroup( nParentId)
@@ -382,7 +381,7 @@ local function GetNextRawInOrd( nCurrRawId)
end
-----------------------------------------------------------------------
local function EnsureZmax( bCloseV, vCmd)
local function EnsureZmax( bCloseV, vCmd, nInd)
-- verifico non sia già inserito nella lista dei comandi
for i = 1, #vCmd do
if vCmd[i][1] == 4 then
@@ -394,7 +393,11 @@ local function EnsureZmax( bCloseV, vCmd)
end
end
-- posizionamento sicuro teste e rulli
table.insert( vCmd, { 4, EgtIf( bCloseV, 1, 0)})
if not nInd then
table.insert( vCmd, { 4, EgtIf( bCloseV, 1, 0)})
else
table.insert( vCmd, nInd, { 4, EgtIf( bCloseV, 1, 0)})
end
return true
end
@@ -570,8 +573,12 @@ function OnSpecialApplyDisposition()
SpecSetCarrPosFromCmds( vCmd2)
-- determino posizione testa trave
local nLastEntId = EgtGetLastInGroup( EgtGetLastInGroup( EgtGetFirstNameInGroup( EgtGetPrev( EMC.DISPID), 'CL')))
local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
if nLastEntId then
local vAxes = EmtGetAxesPos( nLastEntId)
if #vAxes > 0 then EMC.TPOS = vAxes[1] end
else
EMC.TPOS = EgtGetInfo( EMC.DISPID, 'TPOS', 'd')
end
local vCmd3 = SpecCalcUnload()
-- unisco ed emetto i comandi
vCmd = EgtJoinTables( vCmd, vCmd2)
@@ -680,7 +687,7 @@ function OnPostApplyMachining()
local OriY2Delta = EMC.Y2DELTA
local OriV1Pos = EMC.V1POS
local OriV2Pos = EMC.V2POS
local OriCnt = EMC.CNT
local OriCnt = EMC.CNT
-- eseguo le elaborazioni
SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bLast and bUnload)
-- se separazione, verifico il risultato
@@ -737,6 +744,9 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
-- Verifico se lavorazione pareti
local bWall = ( EgtGetInfo( EgtGetCurrMachGroup() or GDB_ID.NULL, 'Wall', 'd') == 1)
-- se il pezzo dev'essere scaricato al carico
local dUnloadType = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'UNLOAD', 'd')
local bUnloadOnLoadPos = dUnloadType == 1 or dUnloadType == -1
-- mi salvo info lavorazione su una lista
local AuxInfoMach = {}
@@ -753,8 +763,13 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
local b3Tot = BBox3d()
local b3Raw = BBox3d()
local nNextOddPhase = GetNextStartOrRestPhase( EMC.PHASE)
-- se esistono più grezzi toglie l'impostazione di scarico al carico
if UnloadOnLoadPos and ( nNextOddPhase and nNextOddPhase <= EgtGetPhaseCount()) then UnloadOnLoadPos = false end
-- se esistono più grezzi toglie l'impostazione di scarico al carico e ritorna errore
if bUnloadOnLoadPos and ( nNextOddPhase and nNextOddPhase <= EgtGetPhaseCount()) then
bUnloadOnLoadPos = false
EMC.ERR = 22
EMC.MSG = ' Error : Unload on Load Position not reachable if raw part on Load Position'
return
end
local nRawId = EgtGetFirstRawPart()
local nCurrRawId = GDB_ID.NULL
while nRawId do
@@ -806,7 +821,7 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload)
local dDistF, dDistB, dRollF, dRollB = SpecialCalcPhaseEncumbrance( EMC.PHASE + 1)
dDistFront = min( dDistFront, dDistF)
-- Se è previsto lo scarico al carico aumenta l'ingombro dell'area di lavoro
if UnloadOnLoadPos then
if bUnloadOnLoadPos then
dDistFront = dDistFront -( MinDeltaYV*2 + AGG_V)
end
dDistBack = min( dDistBack, dDistB)
@@ -1341,12 +1356,20 @@ end
function SpecCalcUnloadOnLoadPos()
local vCmdPre = {}
EgtOutLog( ' *[UL]', 1)
if not EMC.Y1DELTA and not EMC.Y2DELTA then
EMC.ERR = 21
EMC.MSG = ' Error : Y1 and Y2 not clamped for unloading'
return {}
end
-- Se pinza Y2 chiusa, devo effettuare uno scambio
local dY1DeltaMaxSP = MaxY1 - LoadT - TurnerOffs - 10 * GEO.EPS_SMALL
if EMC.Y2DELTA or EMC.Y1DELTA > dY1DeltaMaxSP then
-- imposto quote aggancio per avere solo pinza Y
local dDistFront = 0
local dDistBack = EMC.LB - MinOther - EMC.HOVM + 10 * GEO.EPS_SMALL
-- dico che le paratie sono chiuse perchè poi se ho dei movimenti, verranno chiuse, quindi parto considerandole già chiuse
EMC.V1POS = 0
EMC.V2POS = 0
-- effettuo scambio
vCmdPre = SpecCalcCarriages( dDistFront, dDistBack, 0, 0, dY1DeltaMaxSP)
-- recupero nuova posizione carrelli
@@ -1389,12 +1412,23 @@ function SpecCalcUnload()
-- In caso di condizioni rispettate richiama lo scarico al carico e ritorna
local nNextPathId
local nNextMchId
local nNextDispId
if EMC.PATHID then nNextPathId = EgtGetNextActiveOperation( EMC.PATHID) end
if EMC.MCHID then nNextMchId = EgtGetNextActiveOperation( EMC.MCHID) end
-- Opzione attiva, è l'ultimo path, è l'ultima lavorazione e non c'è rimanenza
if UnloadOnLoadPos and not nNextPathId and not nNextMchId and not IsStartOrRestPhase(EMC.PHASE) then
local vCmd = SpecCalcUnloadOnLoadPos()
return vCmd
if EMC.DISPID then nNextDispId = EgtGetNextActiveOperation( EMC.DISPID) end
-- se il pezzo dev'essere scaricato al carico
local dUnloadType = EgtGetInfo( EgtGetFirstNameInGroup( GDB_ID.ROOT, 'BtlInfo') or GDB_ID.NULL, 'UNLOAD', 'd')
local bUnloadOnLoadPos = dUnloadType == 1 or dUnloadType == -1
if bUnloadOnLoadPos then
-- è l'ultimo path, è l'ultima lavorazione, non ci sono altre disposizioni e non c'è rimanenza
if not nNextPathId and not nNextMchId and not nNextDispId and not IsStartOrRestPhase(EMC.PHASE) then
local vCmd = SpecCalcUnloadOnLoadPos()
return vCmd
else
EMC.ERR = 21
EMC.MSG = ' Error : Unload on Load Position not reachable if raw part on Load Position'
return {}
end
end
local vCmdPre = {}
EgtOutLog( ' *[U]', 1)
@@ -1651,7 +1685,7 @@ local function PosForEnl1FY1( dY1a, dY2a, dTa, dExtra, dCorsaY1e, dCorsaY2Te)
if dDispl/2 <= dCorsaY1e then
dY1a = dY1a + dDispl / 2
dY2a = dY2a - dDispl / 2
dTa = dTa - dDispl / 2
dTa = dTa - dDispl / 2
else
dY1a = dY1a + dCorsaY1e
dY2a = dY2a - (dDispl - dCorsaY1e)
@@ -1673,7 +1707,7 @@ local function PosForEnl1FY2( dY1a, dY2a, dTa, dExtra, dCorsaY1Te, dCorsaY2e)
if dDispl/2 <= dCorsaY1Te then
if dDispl/2 <= dCorsaY2e then
dY1a = dY1a + dDispl / 2
dTa = dTa + dDispl / 2
dTa = dTa + dDispl / 2
dY2a = dY2a - dDispl / 2
else
dY2a = dY2a - dCorsaY2e
+2 -3
View File
@@ -5,7 +5,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1a2_DEV5'
PP_VER = '3.1a2_DEV11'
PP_NVER = '3.1.1.2'
MIN_MACH_VER = '2.7d2'
MACH_NAME = EgtGetCurrMachineName()
@@ -86,7 +86,7 @@ ParkTc2X1 = 3100
ParkZ1 = -545
ParkC1 = -90
ParkB1 = -90
ParkCSawX1 = 1500
ParkCSawX1 = 1700
ParkCSawZ1 = -100
ParkCSaw0Z1 = -400
ParkCSawC1 = -90
@@ -173,7 +173,6 @@ EstimationRapidMultiplier = 1
DistZClampToTable = 5 -- distanza tra la tavola e il punto più basso della morsa
ClampingCoeffMin = nil -- coefficiente di fissaggio, se 0 o nil non fa controllo, per il momento da inizializzare da Ts3Data
MinBeamLenUnloadInLine = 2400 -- se lo scarico è su una linea deve scaricare il pezzo al massimo e deve essere maggiore del valore della variabile
UnloadOnLoadPos = nil
-- Aggiornamento con dati da TechnoEssetre7
local sTs3Data = EgtGetStringFromIni( 'Beam', 'DATA_DIR', "C:\\TechnoEssetre7\\EgtData", EgtGetIniFile()).."\\Essetre-PF1250-3T_5Ax.data"
+3
View File
@@ -1,5 +1,8 @@
==== Common_PF1250 Update Log ====
Versione 3.1b1 (17/02/2026)
- (GEN) Generazione non allineata a simulazione. Ticket#2819
Versione 3.1a2 (30/01/2026)
- (SIM) Allineato approccio simulazione a generazione in caso di lavorazione in doppio verticale. Ticket#2781
- (GEN) Simulazione non allineata a generazione. Mancava reset flag di pezzo a caduta. Ticket#2798
+1 -1
View File
@@ -3,7 +3,7 @@
local InfoCommon_STD_PP = {
NAME = 'Common_PF1250', -- nome script PP standard
VERSION = '3.1a2', -- versione script
VERSION = '3.1b1', -- versione script
MIN_MACH_VER_PP_COMMON = '2.7k1' -- versione minima kernel
}