Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2bfb1b4b27 | |||
| bf0c9460c6 | |||
| a721fda298 | |||
| 47516ad370 | |||
| 09f5c56ac9 | |||
| 7765c9c767 | |||
| 9da3bb88e1 | |||
| aa0d80735b | |||
| 5426a1a07a | |||
| db906c0817 | |||
| 14d5f35f8f | |||
| e039384b87 | |||
| 833c2d95e7 | |||
| 3a20baca05 | |||
| c4c818eb6a |
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
|
||||
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
|
||||
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
|
||||
local TEST_USE = false
|
||||
|
||||
@@ -53,6 +53,7 @@ function OnProgramStart()
|
||||
end
|
||||
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
|
||||
EmtOutput( '(HEADER)')
|
||||
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
|
||||
if TEST_USE then
|
||||
EmtOutput( 'M28')
|
||||
@@ -104,6 +105,7 @@ function OnProgramEnd()
|
||||
EMT.FALL = nil
|
||||
EMT.RELOAD = nil
|
||||
EMT.RELOAD2 = nil
|
||||
EmtOutput( '(FOOTER)')
|
||||
-- Se modalità test, termino il programma
|
||||
if TEST_USE then
|
||||
EmtOutput( 'M02')
|
||||
@@ -1538,7 +1540,7 @@ function MyAdjustLinearAxes()
|
||||
elseif EMT.HEAD ~= 'H3' then
|
||||
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
|
||||
local LenRef = MillOffs
|
||||
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
|
||||
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
|
||||
else
|
||||
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
|
||||
local LenRef = MillOffs
|
||||
|
||||
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
|
||||
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
|
||||
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
|
||||
local TEST_USE = false
|
||||
|
||||
@@ -53,6 +53,7 @@ function OnProgramStart()
|
||||
end
|
||||
EmtOutput( sPrefixCommentLine..'('.. CSP_INFO..')')
|
||||
EmtOutput( sPrefixCommentLine..'('.. MACHINE_INFO..')\n')
|
||||
EmtOutput( '(HEADER)')
|
||||
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
|
||||
if TEST_USE then
|
||||
EmtOutput( 'M28')
|
||||
@@ -108,6 +109,7 @@ function OnProgramEnd()
|
||||
EMT.FALL = nil
|
||||
EMT.RELOAD = nil
|
||||
EMT.RELOAD2 = nil
|
||||
EmtOutput( '(FOOTER)')
|
||||
-- Se modalità test, termino il programma
|
||||
if TEST_USE then
|
||||
EmtOutput( 'M02')
|
||||
@@ -1640,7 +1642,7 @@ function MyAdjustLinearAxes()
|
||||
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
|
||||
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
|
||||
local LenRef = MillOffs
|
||||
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
|
||||
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
|
||||
elseif EMT.HEAD == 'H3' then
|
||||
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
|
||||
local LenRef = MillOffs
|
||||
|
||||
+46
-41
@@ -6,7 +6,7 @@ local INFO_STD_PP = require( 'Version')
|
||||
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 CSP_INFO = INFO_STD_PP.NAME..'_'..NumericalControl..' ver.'..INFO_STD_PP.VERSION..' by EgalWare s.r.l.'
|
||||
local MACHINE_INFO = MACH_NAME..' ver.'..PP_VER
|
||||
local TEST_USE = false
|
||||
|
||||
@@ -21,13 +21,16 @@ function OnStart()
|
||||
EMT.USETO1 = false -- abilitazione uso origine tavola
|
||||
EMT.MODAL = true -- abilitazione emissione modale
|
||||
EMT.INCHES = false -- unità di misura mm/inches
|
||||
EMT.DECNUM = 5 -- numero di decimali dopo la virgola
|
||||
EMT.DECNUM = 4 -- numero di decimali dopo la virgola
|
||||
EMT.DECVERS = 6 -- numero di decimali dopo la virgola per versori
|
||||
EMT.DECRAD = 4 -- numero di decimali dopo la virgola per raggio
|
||||
EMT.DECMACRO = 3 -- numero di decimali dopo la virgola per macro
|
||||
EMT.NUM = false -- abilitazione numerazione linee
|
||||
--EMT.Nt = 'N' -- token per la numerazione di linea
|
||||
--EMT.LINENBR = 0 -- numero di linea
|
||||
--EMT.LINEINC = 1 -- incremento numerazione linee
|
||||
--EMT.Ft = 'F' -- token per feed
|
||||
--EMT.St = 'S' -- token per speed
|
||||
--EMT.Nt = 'N' -- token per la numerazione di linea
|
||||
--EMT.LINENBR = 0 -- numero di linea
|
||||
--EMT.LINEINC = 1 -- incremento numerazione linee
|
||||
--EMT.Ft = 'F' -- token per feed
|
||||
--EMT.St = 'S' -- token per speed
|
||||
EMT.FMAXPINZE = 154000 -- feed massima pinze
|
||||
end
|
||||
|
||||
@@ -51,6 +54,7 @@ function OnProgramStart()
|
||||
end
|
||||
ParkLine( sPrefixCommentLine..'('.. CSP_INFO..')')
|
||||
ParkLine( sPrefixCommentLine..'('.. MACHINE_INFO..')')
|
||||
ParkLine( '(HEADER)')
|
||||
|
||||
-- Se modalità test, aggiungo linee per muovere tappeto e alzare la testa (in automatico viene fatto dal main residente)
|
||||
if TEST_USE then
|
||||
@@ -108,6 +112,7 @@ function OnProgramEnd()
|
||||
EMT.FALL = nil
|
||||
EMT.RELOAD = nil
|
||||
EMT.RELOAD2 = nil
|
||||
EmtOutput( '(FOOTER)')
|
||||
-- Termino il programma
|
||||
EmtOutput( 'M02')
|
||||
end
|
||||
@@ -116,8 +121,8 @@ end
|
||||
function OnToolData()
|
||||
-- emissione dati utensili
|
||||
if EMT.HEAD == 'H1' then
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
|
||||
ParkLine( sOut)
|
||||
-- cerco posizione di attrezzaggio del primo utensile di lavorazione
|
||||
if EMT.TOOL == EMT.TOOL_1 and EMT.TLEN_1 < LONG_TOOL_MINLEN then
|
||||
@@ -125,14 +130,14 @@ function OnToolData()
|
||||
end
|
||||
-- emissione dati lama
|
||||
elseif EMT.HEAD == 'H2' then
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
|
||||
ParkLine( sOut)
|
||||
-- emissione dati sega a catena
|
||||
elseif EMT.HEAD == 'H3' then
|
||||
if EMT.TDIST and abs( EMT.TDIST) < 0.1 then EMT.TDIST = nil end
|
||||
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3) .. ' P3=' .. EmtLenToString( EMT.TLEN, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), 3)
|
||||
local sData = ' P2=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( ( EMT.TDIST or ChSawLen), EMT.DECMACRO)
|
||||
if EMT.TCPOS == 'T101' then
|
||||
ParkLine( 'M992 P1=101' .. sData)
|
||||
ParkLine( 'M992 P1=102' .. sData)
|
||||
@@ -148,13 +153,13 @@ function OnToolData()
|
||||
elseif EMT.HEAD == 'H5' or EMT.HEAD == 'H6' then
|
||||
local nPos = EgtIf( EMT.HEAD == 'H5', 91, 93)
|
||||
if EMT.EXIT == 2 then nPos = nPos + 1 end
|
||||
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
|
||||
local sOut = 'M992 P1=' .. EgtNumToString( nPos, 0) .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
|
||||
ParkLine( sOut)
|
||||
-- emissione dati sega a catena
|
||||
elseif EMT.HEAD == 'H7' then
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, 3) .. ' P3=' .. EmtLenToString( EMT.TDIAM, 3) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, 3) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, 3)
|
||||
local sOut = 'M992 P1=' .. EMT.TCPOS:gsub( 'T', '') .. ' P2=' .. EmtLenToString( EMT.TLEN, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.TDIAM, EMT.DECMACRO) ..
|
||||
' P4=' .. EmtLenToString( EMT.SMAX, EMT.DECMACRO) .. ' P5=' .. EmtLenToString( EMT.TTOTLEN, EMT.DECMACRO)
|
||||
ParkLine( sOut)
|
||||
-- altro non previsto
|
||||
else
|
||||
@@ -224,8 +229,8 @@ function OnDispositionEnd()
|
||||
|
||||
if IdTrave >= 0 then
|
||||
local sPrt = '( *** Part '.. EgtNumToString( IdTrave, 0) ..' ***)'
|
||||
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, 3) .. ' L='..EmtLenToString( LTrave, 3) ..
|
||||
' H=' .. EmtLenToString( HTrave, 3) .. ' S=' .. EmtLenToString( STrave, 3) .. ' )'
|
||||
local sOut = '( SN=' .. IdTrave .. ' LBarra=' .. EmtLenToString( LBarra, EMT.DECMACRO) .. ' L='..EmtLenToString( LTrave, EMT.DECMACRO) ..
|
||||
' H=' .. EmtLenToString( HTrave, EMT.DECMACRO) .. ' S=' .. EmtLenToString( STrave, EMT.DECMACRO) .. ' )'
|
||||
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
|
||||
@@ -656,9 +661,9 @@ function OnRapid()
|
||||
local bZmax = ( #EMT.AUXSTR > 0 or EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
-- se avevo motosega, torno in zona sicura senza ruotare assi rotanti
|
||||
if EMT.PREVHEAD == 'H3' and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2pp, 3) .. ' P5=' .. EgtNumToString( EMT.R1pp, 3) ..
|
||||
' P6=' .. EgtNumToString( EMT.PREVTCPOS, 3) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
|
||||
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2pp, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1pp, EMT.DECMACRO) ..
|
||||
' P6=' .. EgtNumToString( EMT.PREVTCPOS, EMT.DECMACRO) .. ' P7=' .. EgtNumToString( EMT.PREVS, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
|
||||
EmtOutput( sOutPreMove)
|
||||
EmtOutput( 'M101 P1=2')
|
||||
@@ -672,8 +677,8 @@ function OnRapid()
|
||||
|
||||
-- se carico motosega, ruoto in zona sicura prima di approcciare la lavorazione
|
||||
if ( EMT.HEAD == 'H3' or ( bZmax and EMT.TTOTLEN > 200)) and EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( MyZHome, 3) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
|
||||
local sOutPreMove = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZHome, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
|
||||
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
|
||||
EmtOutput( sOutPreMove)
|
||||
@@ -687,8 +692,8 @@ function OnRapid()
|
||||
if EMT.ST > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
MyZPos = MyZHome
|
||||
end
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( MyZPos, 3) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( MyZPos, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
|
||||
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=' .. EgtIf( bZmax, '3', '4')
|
||||
if EMT.LOAD then
|
||||
@@ -738,7 +743,7 @@ function OnRapid()
|
||||
sV = EmtLenToString( ParkV)
|
||||
sB = '2'
|
||||
end
|
||||
sOut = 'M112 P1='..EmtLenToString( EMT.L1, 3)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
|
||||
sOut = 'M112 P1='..EmtLenToString( EMT.L1, EMT.DECMACRO)..' P3='..sA..' P4='..sB..' P5=0 P6='..sY..' P7='..sV..' P9='..GetFmaxClamp()
|
||||
ParkLine( sOut)
|
||||
EMT.LOAD = false
|
||||
-- emissione prime linee speciali e linee parcheggiate
|
||||
@@ -789,7 +794,7 @@ function OnRapid()
|
||||
sOut = 'M101 P1=3'
|
||||
EmtOutput( sOut)
|
||||
end
|
||||
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, 3) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
|
||||
sOut = 'M112 P1=' .. EmtLenToString( EMT.L1, EMT.DECMACRO) ..' P3='..sA..' P4='..sB..' P6='..sY..' P7='..sV..' P9=' .. GetFmaxClamp()
|
||||
EmtOutput( sOut)
|
||||
if not bHeadFirst then
|
||||
sOut = 'M101 P1=2'
|
||||
@@ -861,15 +866,15 @@ function OnRapid()
|
||||
if EMT.ST > BeamHeightForFixRot and EMT.HEAD == 'H1' and EMT.TOOL ~= EMT.NEXTTOOL and EMT.NEXTHEAD ~= 'H2' then
|
||||
local dBAxis = 90
|
||||
local dCAxis = EgtIf( BD.RIGHT_LOAD, 90, -90)
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
|
||||
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
|
||||
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=3'
|
||||
EmtOutput( sOut)
|
||||
EmtOutput( 'M101 P1=2')
|
||||
EmtOutput( 'M101 P1=3')
|
||||
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
|
||||
' P4=' .. EgtNumToString( dBAxis, 3) .. ' P5=' .. EgtNumToString( dCAxis, 3) ..
|
||||
sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( -SafeXRotAxes, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( dBAxis, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( dCAxis, EMT.DECMACRO) ..
|
||||
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=3'
|
||||
EmtOutput( sOut)
|
||||
@@ -886,8 +891,8 @@ function OnRapid()
|
||||
MyAdjustLinearAxes()
|
||||
EmtAdjustRotaryAxes()
|
||||
EmtResetPrev()
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, 3) .. ' P3=' .. EmtLenToString( EMT.L3, 3) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, 3) .. ' P5=' .. EgtNumToString( EMT.R1, 3) ..
|
||||
local sOut = 'M101 P1=1' .. ' P2=' .. EmtLenToString( EMT.L2, EMT.DECMACRO) .. ' P3=' .. EmtLenToString( EMT.L3, EMT.DECMACRO) ..
|
||||
' P4=' .. EgtNumToString( EMT.R2, EMT.DECMACRO) .. ' P5=' .. EgtNumToString( EMT.R1, EMT.DECMACRO) ..
|
||||
' P6=' .. AdjustTcPos( false) .. ' P7=' .. EgtNumToString( EMT.S, 0) ..
|
||||
' P8=0' .. ' P9=0' .. ' P10=3'
|
||||
EmtOutput( sOut)
|
||||
@@ -1007,7 +1012,7 @@ function OnArc()
|
||||
--local sCen = ' ' .. EMT.C1t .. EmtLenToString(EMT.C1,3) ..
|
||||
-- ' ' .. EMT.C2t .. EmtLenToString(EMT.C2,3)
|
||||
-- raggio
|
||||
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECNUM)
|
||||
local sRad = ' ' .. EMT.RRt .. EmtLenToString( EMT.RR, EMT.DECRAD)
|
||||
-- aggiungo feed
|
||||
local sFeed = EmtGetFeed()
|
||||
-- tipo arco
|
||||
@@ -1639,7 +1644,7 @@ function MyAdjustLinearAxes()
|
||||
if EMT.HEAD == 'H1' or EMT.HEAD == 'H2' then
|
||||
local Len = EMT.TLEN + EgtIf( EMT.HEAD == 'H1', MillOffs, abs( SawOffs))
|
||||
local LenRef = MillOffs
|
||||
vtE = Vector3d( EMT.EXTR) * Len - Z_AX() * LenRef
|
||||
vtE = Vector3d( EMT.TDIR) * Len - Z_AX() * LenRef
|
||||
elseif EMT.HEAD == 'H3' then
|
||||
local LenAux = ( EMT.TDIST or ChSawLen) + MillOffs
|
||||
local LenRef = MillOffs
|
||||
@@ -1650,13 +1655,13 @@ function MyAdjustLinearAxes()
|
||||
local LenAux = MillOffs + AngTr1Offs
|
||||
local LenRef = MillOffs
|
||||
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
|
||||
vtE = Vector3d( EMT.EXTR) * Len + vtAux * LenAux - Z_AX() * LenRef
|
||||
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
|
||||
elseif EMT.HEAD == 'H7' then
|
||||
local Len = EMT.TLEN + AngTrBHLen
|
||||
local LenAux = MillOffs + AngTrBHOffs
|
||||
local LenRef = MillOffs
|
||||
local vtAux = EgtGetCalcAuxDirFromAngles( EMT.R1, EMT.R2)
|
||||
vtE = Vector3d( EMT.EXTR) * Len + vtAux * LenAux - Z_AX() * LenRef
|
||||
vtE = Vector3d( EMT.TDIR) * Len + vtAux * LenAux - Z_AX() * LenRef
|
||||
else
|
||||
EmtSetLastError( 1211, 'Head not allowed ' .. EMT.HEAD)
|
||||
end
|
||||
@@ -1767,9 +1772,9 @@ function CalcInterpPlane()
|
||||
local vtY = EMT.IPLGLFR:getVersY()
|
||||
local vtZ = EMT.IPLGLFR:getVersZ()
|
||||
EMT.IPLGLSTR = ' X0 Y' .. EmtLenToString( xS, EMT.DECNUM) .. ' Z0' ..
|
||||
' A' .. EgtNumToString( - vtX:getY(), 6) .. ' B' .. EgtNumToString( vtX:getX(), 6) .. ' C' .. EgtNumToString( vtX:getZ(), 6) ..
|
||||
' I' .. EgtNumToString( - vtY:getY(), 6) .. ' J' .. EgtNumToString( vtY:getX(), 6) .. ' K' .. EgtNumToString( vtY:getZ(), 6) ..
|
||||
' P' .. EgtNumToString( - vtZ:getY(), 6) .. ' Q' .. EgtNumToString( vtZ:getX(), 6) .. ' R' .. EgtNumToString( vtZ:getZ(), 6)
|
||||
' A' .. EgtNumToString( - vtX:getY(), EMT.DECVERS) .. ' B' .. EgtNumToString( vtX:getX(), EMT.DECVERS) .. ' C' .. EgtNumToString( vtX:getZ(), EMT.DECVERS) ..
|
||||
' I' .. EgtNumToString( - vtY:getY(), EMT.DECVERS) .. ' J' .. EgtNumToString( vtY:getX(), EMT.DECVERS) .. ' K' .. EgtNumToString( vtY:getZ(), EMT.DECVERS) ..
|
||||
' P' .. EgtNumToString( - vtZ:getY(), EMT.DECVERS) .. ' Q' .. EgtNumToString( vtZ:getX(), EMT.DECVERS) .. ' R' .. EgtNumToString( vtZ:getZ(), EMT.DECVERS)
|
||||
EMT.IPLGL = true
|
||||
end
|
||||
|
||||
|
||||
+65
-6
@@ -466,8 +466,10 @@ function OnSimulToolSelect( dPosA)
|
||||
EMT.TOTDIAM = EgtTdbGetCurrToolParam( MCH_TP.TOTDIAM)
|
||||
-- se non è chiamato da altro script (non c'è parametro)
|
||||
if not dPosA then
|
||||
-- se attivo Vmill
|
||||
SetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
-- se utensile non flottante, abilito per Vmill
|
||||
if not EMT.TFLOAT then
|
||||
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL)
|
||||
end
|
||||
-- se attivo Collision Check
|
||||
EMT.SAFEDIST = COLL_SAFE_DIST
|
||||
if EMT.COLLOBJ then
|
||||
@@ -527,6 +529,14 @@ function OnSimulToolSelect( dPosA)
|
||||
EgtSetAxisPos( 'B', 0)
|
||||
end
|
||||
end
|
||||
-- se TC 1
|
||||
if GetTCSet( EMT.TCPOS) == 1 then
|
||||
EgtSetAxisPos( 'B', 90)
|
||||
else
|
||||
if EMT.HEAD ~= 'H3' then
|
||||
EgtSetAxisPos( 'B', -90)
|
||||
end
|
||||
end
|
||||
-- breve pausa
|
||||
EgtPause( 100)
|
||||
EgtOutText( '')
|
||||
@@ -576,7 +586,11 @@ function OnSimulToolDeselect()
|
||||
-- altrimenti posizioni standard rastrelliera
|
||||
else
|
||||
SimulMoveAxis( 'X', 0, MCH_SIM_STEP.RAPID)
|
||||
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
||||
if GetTCSet( EMT.TCPOS) == 1 then
|
||||
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
||||
else
|
||||
SimulMoveAxes( 'B', -90, MCH_SIM_STEP.COLLROT, 'C', -90, MCH_SIM_STEP.COLLROT)
|
||||
end
|
||||
end
|
||||
-- movimento scarico utensile di grosso diametro (su T111)
|
||||
else
|
||||
@@ -590,18 +604,25 @@ function OnSimulToolDeselect()
|
||||
-- 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
|
||||
if EMT.NEXTHEAD ~= 'H3' and EMT.NEXTHEAD ~= 'H5' and EMT.NEXTHEAD ~= 'H6' then
|
||||
SimulMoveAxes( 'B', 90, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
||||
SimulMoveAxes( 'B', EgtIf( GetTCSet( EMT.TCPOS) == 1, 90, -90), MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
||||
else
|
||||
SimulMoveAxes( 'B', 0, MCH_SIM_STEP.RAPROT, 'C', EgtIf( BD.RIGHT_LOAD, 90, -90), MCH_SIM_STEP.RAPROT)
|
||||
end
|
||||
-- se segue lama, carico utensile di default
|
||||
if EMT.NEXTHEAD == 'H2' then
|
||||
local sDefTool = GetDefaultToolName()
|
||||
EgtLoadTool( 'H1', 1, sDefTool)
|
||||
EMT.TOOL_1 = sDefTool
|
||||
EMT.TCPOS_1 = GetToolTcPos( EMT.TOOL_1)
|
||||
-- se TC 1
|
||||
if GetTCSet( EMT.TCPOS_1) == 1 then
|
||||
EgtSetAxisPos( 'B', 90)
|
||||
else
|
||||
EgtSetAxisPos( 'B', -90)
|
||||
end
|
||||
EgtLoadTool( 'H1', 1, sDefTool)
|
||||
-- lo nascondo sul portautensili
|
||||
ShowToolInTcPos( EMT.TCPOS_1, false)
|
||||
end
|
||||
@@ -768,7 +789,6 @@ function OnSimulMoveStart()
|
||||
EgtOutText( '')
|
||||
EMT.MCHFIRST = false
|
||||
local bZmax = ( EMT.TOOL ~= EMT.PREVTOOL or EMT.L3 > -1)
|
||||
|
||||
-- con pezzi alti aggiorno gli assi rotanti prima di muovermi sopra il pezzo
|
||||
if not EMT.LOAD and EMT.MOVE == 0 and EMT.HB > BeamHeightForFixRot and EMT.FLAG2 == 1 then
|
||||
-- se motosega mi muovo a X di sicurezza per ruotare
|
||||
@@ -778,20 +798,59 @@ function OnSimulMoveStart()
|
||||
end
|
||||
EMT.POSTROT = nil
|
||||
end
|
||||
-- se aggregato flottante su inizio attacco va compresso
|
||||
if EMT.TFLOAT and not EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LI' then
|
||||
-- recupero lunghezza
|
||||
local dOffsL = - EgtGetMachiningParam( MCH_MP.OFFSL)
|
||||
-- imposto compressione della parte flottante
|
||||
SetFloatPos( EMT.HEAD, dOffsL)
|
||||
-- imposto dati utensile in posizione compressa
|
||||
EmtSetToolForVmill( EMT.TOOL, EMT.HEAD, EMT.EXIT, EMT.VMILL, 2, -dOffsL)
|
||||
-- dichiaro che è compresso (assegnando Id entità di movimento)
|
||||
EMT.TFLOAT_CMP = EMT.MOVEID
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulMoveEnd()
|
||||
-- se termine di passata con lama
|
||||
if EMT.FLAG == 301 then
|
||||
-- rimozione eventuali sfridi
|
||||
ExecRemoveScraps()
|
||||
end
|
||||
-- se utensile flottante e movimento di compressione
|
||||
if EMT.TFLOAT and EMT.MOVEID == EMT.TFLOAT_CMP then
|
||||
-- verifico ci sia stata collisione tra ghiera flottante (portautensile e pezzo)
|
||||
if not EMT.TFLOAT_TH_COMPR_COLL then
|
||||
local sErr = 'CUTID='..tostring( EMT.CUTID)..'; TASKID='..tostring( EMT.TASKID)..'; Mach='..EMT.MCHNAME..'; Floating Ring not compressed on approach'
|
||||
EmtSetLastError( 1222, sErr)
|
||||
EgtOutLog( 'Error : ' .. sErr, 1)
|
||||
else
|
||||
EgtOutLog( 'Floating Ring compressed on approach (MOVEID='..EgtNumToString( EMT.MOVEID)..')', 1)
|
||||
end
|
||||
EMT.TFLOAT_TH_COMPR_COLL = nil
|
||||
end
|
||||
-- se aggregato flottante su fine uscita va rilasciato
|
||||
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.MOVE == 1 and EgtGetName( EMT.MOVEID) == 'LO' and EgtGetName( EgtGetNext( EMT.MOVEID) or GDB_ID.NULL) ~= 'LO' then
|
||||
-- reset compressione della parte flottante
|
||||
SetFloatPos( EMT.HEAD, 0)
|
||||
-- dichiaro che è rilasciato
|
||||
EMT.TFLOAT_CMP = nil
|
||||
end
|
||||
end
|
||||
|
||||
---------------------------------------------------------------------
|
||||
function OnSimulCollision()
|
||||
-- se prima collisione della lavorazione, la segnalo
|
||||
if EMT.MCHNAME ~= EMT.LAST_MCHNAME_COLLIDE then
|
||||
-- speciale per utensile flottante (suo holder contro il grezzo)
|
||||
if EMT.TFLOAT and EMT.TFLOAT_CMP and EMT.SIMCOBIND == 1002 and EMT.SIMVMID == EMT.VMILL[1] then
|
||||
if EMT.MOVEID == EMT.TFLOAT_CMP then
|
||||
EMT.TFLOAT_TH_COMPR_COLL = true
|
||||
end
|
||||
return
|
||||
end
|
||||
-- standard
|
||||
local Class = ''
|
||||
if EMT.SIMCOBIND == 1001 then
|
||||
Class = 'T_H1'
|
||||
|
||||
+41
-2
@@ -7,6 +7,12 @@ EgtEnableDebug( false)
|
||||
-- carico librerie
|
||||
local BD = require( 'BeamData')
|
||||
|
||||
---------------------------------------------------------------------
|
||||
-- *** Generic Machinings ***
|
||||
---------------------------------------------------------------------
|
||||
pcall( require, 'EmtGenMachining') -- si fa una require con PCALL perchè la libreria è opzionale
|
||||
|
||||
|
||||
---------------------- OnSpecialMoveZup -----------------------------
|
||||
---------------------------------------------------------------------
|
||||
function OnSpecialMoveZup()
|
||||
@@ -367,7 +373,18 @@ function OnSpecialApplyDisposition()
|
||||
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
|
||||
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
||||
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
||||
|
||||
|
||||
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES) or ''
|
||||
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||
if dHCING then
|
||||
EMC.HCING = max( dHCING, -50)
|
||||
end
|
||||
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||
if dTCING then
|
||||
EMC.TCING = max( dTCING, -50)
|
||||
end
|
||||
|
||||
-- Devo scaricare il pezzo o il grezzo rimasto
|
||||
-- Posizione trave
|
||||
local dPosT
|
||||
@@ -511,6 +528,17 @@ function OnPostApplyMachining()
|
||||
local bSplitting = ( sNotes:find( 'Split') ~= nil)
|
||||
local bPreCut = ( sNotes:find( 'Precut') ~= nil)
|
||||
local bCutting = ( sNotes:find( 'Cut') ~= nil)
|
||||
|
||||
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||
if dHCING then
|
||||
EMC.HCING = max( dHCING, -50)
|
||||
end
|
||||
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||
if dTCING then
|
||||
EMC.TCING = max( dTCING, -50)
|
||||
end
|
||||
|
||||
local bUnload = IsEndPhase( EMC.PHASE) or IsEnd2Phase( EMC.PHASE)
|
||||
if bPreSplit or bPreCut then
|
||||
EgtSetInfo( EMC.MCHID, 'IS_PRE', '1')
|
||||
@@ -634,6 +662,17 @@ function SpecApplyPath( bPreSplit, bSplitting, bPreCut, bCutting, bUnload, bPreR
|
||||
EMC.HOVM = EgtGetInfo( nCurrRawId, 'HOVM', 'd') or 0
|
||||
EMC.HCING = EgtGetInfo( nCurrRawId, 'HCING', 'd') or 0
|
||||
EMC.TCING = EgtGetInfo( nCurrRawId, 'TCING', 'd') or 0
|
||||
|
||||
-- correggo area non pinzabile in testa o coda in base alle info sulla lavorazione
|
||||
local sNotes = EgtGetMachiningParam( MCH_MP.USERNOTES)
|
||||
local dHCING = tonumber( EgtGetValInNotes( sNotes, 'HCING'))
|
||||
if dHCING then
|
||||
EMC.HCING = max( dHCING, -50)
|
||||
end
|
||||
local dTCING = tonumber( EgtGetValInNotes( sNotes, 'TCING'))
|
||||
if dTCING then
|
||||
EMC.TCING = max( dTCING, -50)
|
||||
end
|
||||
|
||||
-- Calcolo dell'ingombro della lavorazione
|
||||
local dDistFront, dDistBack = SpecialCalcMachiningEncumbrance( EMC.MCHID, bPreCut)
|
||||
@@ -1682,7 +1721,7 @@ function SpecAdjustCarriages( vCmd, dTPosI, dYDeltaI, dVDeltaI, dTPosF, dYDeltaF
|
||||
if abs( dYDeltaF - dYDeltaI) > 10 * GEO.EPS_SMALL then
|
||||
table.insert( vCmd, { 11, 0})
|
||||
dYPosA = max( MyMinY, dTPosI + dYDeltaF)
|
||||
dTPosA = -( dYPosA + dVDeltaF)
|
||||
dTPosA = dYPosA - dYDeltaF
|
||||
dVPosA = dTPosA + dVDeltaF
|
||||
table.insert( vCmd, { 3, 'Y', dYPosA , 'T', dTPosA, 'V', dVPosA})
|
||||
table.insert( vCmd, { 11, CalcCharStatus( 'Y', dYDeltaF)})
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
==== Common_FAST Update Log ====
|
||||
|
||||
Versione 2.7c1 (26/03/2024)
|
||||
- (GEN) All'inizio del codice ISO si scrive nel commento anche il controllo numerico utilizzato per la generazione.
|
||||
- (GEN) Aggiunta commenti HEADER e FOOTER per comunicazione con linea o altre macchine, da parte di Essetre.
|
||||
- (GEN) In MyAdjustLinearAxes si utilizza TDIR per calcolarsi gli offset per compatibilità con lavorazioni a 5 assi.
|
||||
|
||||
Versione 2.7b1 (20/02/2024)
|
||||
- (SIM-GEN) Aggiunta possibilità di settare HCING/TCING nelle note di ogni singola lavorazione per gestire parte non pinzabile del pezzo. Funziona solo con nuovo pinzaggio.
|
||||
- (SIM-GEN) Piccola correzione calcolo posizione carrelli con nuova strategia di pinzaggio.
|
||||
- (SIM-GEN) Caricamento libreria EmtGenMachining. Si fa una require con PCALL perchè la libreria è opzionale e non è detto che ci sia. In installazione CAM5 dalla 2.7a1
|
||||
- (GEN) Per controllo TPA, modifica al numero di decimali.
|
||||
- (SIM) Aggiunta gestione per ToolHolder flottante
|
||||
|
||||
Versione 2.7a3 (08/01/2024)
|
||||
- (GEN) Dopo separazione, in NUM_PLUS, si srive EH1 solo se macro G101, perchè altrimenti non è prevista. Ticket#2239
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
local InfoCommon_STD_PP = {
|
||||
NAME = 'Common_FAST', -- nome script PP standard
|
||||
VERSION = '2.7a3', -- versione script
|
||||
VERSION = '2.7c1', -- versione script
|
||||
MIN_MACH_VER_PP_COMMON = '2.5k1' -- versione minima kernel
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user