Compare commits

...

2 Commits

Author SHA1 Message Date
andrea.villa cad19cffca Corretta gestione paraemtro LASTOISBRAKE 2026-04-23 08:30:19 +02:00
daniele.nicoli 77cf0826d5 Sistemata emissione freno (M125) scarico al carico anche in caso di PreparePreRotation() 2026-04-22 15:21:51 +02:00
2 changed files with 43 additions and 20 deletions
+42 -19
View File
@@ -303,22 +303,27 @@ function OnDispositionEnd()
-- Se è un'istruzione del piano ferma pezzo
if EMT.MDCHAR[i].StopBeamStat then
EmitStopBeam( EMT.MDCHAR[i])
EMT.LASTOISBRAKE = true
else
EmitMoveDataChars( EMT.MDCHAR[i])
if EMT.MDCHAR[i].Y1 then EMT.CHY_ON = true end
if EMT.MDCHAR[i].V1 then EMT.V1POS = EMT.MDCHAR[i].V1 end
if EMT.MDCHAR[i].V2 then EMT.V2POS = EMT.MDCHAR[i].V2 end
EMT.LASTOISBRAKE = false
end
end
if #EMT.MDCHAR > 0 then
EMT.LASTOISBRAKE = nil
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
-- se dopo c'è scarico spezzone devo mettere attesa termine esecuzione
if IsRestPhase( EMT.PHASE + 1) then
EmitMoveWaitChars( nMoveType)
if not EMT.LASTOISBRAKE then
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
-- se dopo c'è scarico spezzone devo mettere attesa termine esecuzione
if IsRestPhase( EMT.PHASE + 1) then
EmitMoveWaitChars( nMoveType)
else
EmitMoveWaitChars( nMoveType, true)
end
else
EmitMoveWaitChars( nMoveType, true)
EMT.LASTOISBRAKE = nil
end
-- emissione conclusione pezzo precedente (se non in modalità test)
@@ -539,22 +544,28 @@ function OnMachiningEnd()
-- Se è un'istruzione del piano ferma pezzo
if EMT.MDCHAR[i].StopBeamStat then
EmitStopBeam( EMT.MDCHAR[i])
EMT.LASTOISBRAKE = true
else
EmitMoveDataChars( EMT.MDCHAR[i])
EMT.LASTOISBRAKE = false
end
end
if #EMT.MDCHAR > 0 then
if EMT.AUXTYPE == 'S' then
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
if not EMT.LASTOISBRAKE then
EmitMoveStartChars( 1)
EmitMoveWaitChars( 1)
end
elseif EMT.AUXTYPE == 'U' then
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
-- se dopo cè scarico spezzone devo mettere attesa termine esecuzione
if IsRestPhase( EMT.PHASE + 1) then
EmitMoveWaitChars( nMoveType)
else
EmitMoveWaitChars( nMoveType, true)
if not EMT.LASTOISBRAKE then
local nMoveType = EgtIf( EMT.CHY_ON, 3, 2)
EmitMoveStartChars( nMoveType)
-- se dopo cè scarico spezzone devo mettere attesa termine esecuzione
if IsRestPhase( EMT.PHASE + 1) then
EmitMoveWaitChars( nMoveType)
else
EmitMoveWaitChars( nMoveType, true)
end
end
-- emissione conclusione pezzo precedente (se non è modalità test)
if not TEST_USE and EMT.PRODID then
@@ -562,8 +573,10 @@ function OnMachiningEnd()
MyOutput( sEnd)
end
elseif EMT.AUXTYPE == 'P' then
EmitMoveStartChars( 3)
EmitMoveWaitChars( 3)
if not EMT.LASTOISBRAKE then
EmitMoveStartChars( 3)
EmitMoveWaitChars( 3)
end
if EMT.FALL then
MyOutput( 'M155')
-- emissione conclusione pezzo (se non in modalità test)
@@ -2217,6 +2230,12 @@ function PreparePreRotation( sCmd, nInd)
MDChar = { [Cmd[2]]=tonumber(Cmd[3]), IniStatY1=86, FinStatY1=87, IniStatY2=1, BeamVise=0}
end
table.insert( EMT.MDCHAR, MDChar)
-- Se scarico in linea con abbassamento piano ferma pezzo allo scarico
if Cmd[4] == 'UnBrakeBeam' then
-- Abbassa ferma pezzo
local MDStopBeam = { StopBeamStat=2, Load=1}
table.insert( EMT.MDCHAR, MDStopBeam)
end
end
elseif Cmd[1] == '2' then
local MDChar = { IniStatY1=EMT.ISY1, FinStatY1=EMT.FSY1, IniStatY2=EMT.ISY2, FinStatY2=EMT.FSY2, IniStatV2=1, BeamVise=EMT.BV}
@@ -2228,6 +2247,11 @@ function PreparePreRotation( sCmd, nInd)
EMT.ROLL_IN = nil
end
table.insert( EMT.MDCHAR, MDChar)
-- Alza ferma pezzo
if Cmd[6] == 'BrakeBeam' then
local MDStopBeam = { StopBeamStat=1, Load=1}
table.insert( EMT.MDCHAR, MDStopBeam)
end
elseif Cmd[1] == '3' then
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
@@ -3150,7 +3174,6 @@ function EmitStopBeam( MoData)
end
end
MyOutput( sOut)
EMT.LASTOISBRAKE = true
end
---------------------------------------------------------------------
+1 -1
View File
@@ -5,7 +5,7 @@
require( 'EmtGenerator')
EgtEnableDebug( false)
PP_VER = '3.1a2_DEV20'
PP_VER = '3.1a2_DEV22'
PP_NVER = '3.1.1.2'
MIN_MACH_VER = '2.7d2'
MACH_NAME = EgtGetCurrMachineName()