Files
luca.mazzoleni e84c50902b first commit
2024-02-05 16:11:47 +01:00

64 lines
1.7 KiB
Plaintext

-- Special Operations macchina Essetre-WALL by EgalTech s.r.l. 2020/11/16
-- Intestazioni
require( 'EmtGenerator')
EgtEnableDebug( false)
EgtOutLog ( '** Essetre-WALL.mlse '..PP_VER..' **', 1)
---------------------------------------------------------------------
function OnSpecialMoveZup()
-- Inizializzazioni
EMC.MODIF = false
EMC.ERR = 1
-- Se fresa
if EMC.HEAD == 'H1' then
if EMC.L3 > -300 then
EMC.R1 = EgtGetAxisHomePos( 'C1')
EMC.R2 = EgtGetAxisHomePos( 'B1')
EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
EMC.MODIF = true
end
-- se altrimenti sega a catena
elseif EMC.HEAD == 'H3' then
-- disabilito
do EMC.ERR = 0 return end
local L3New = EMC.L3
local R1New = EMC.R1
local R2New = EMC.R2
if EMC.L3 > -300 then
L3New = min( EMC.L3, -250)
R1New = EgtGetAxisHomePos( 'C1')
R2New = EgtGetAxisHomePos( 'B1')
EMC.MODIF = true
end
if EMC.L2 > -1200 then
R1New = 180
EMC.MODIF = true
elseif EMC.L2 < -4700 then
R1New = 0
EMC.MODIF = true
end
if EMC.MODIF then
EMC.L3 = L3New
EMC.R1 = R1New
EMC.R2 = R2New
EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2, EMC.R3)
end
-- se altrimenti lama
elseif EMC.HEAD == 'H2' then
if EMC.L3 > -200 then
EMC.R1 = EgtGetAxisHomePos( 'C2')
EMC.R2 = EgtGetAxisHomePos( 'B2')
EMC.TDIR = EgtGetCalcToolDirFromAngles( EMC.R1, EMC.R2)
EMC.MODIF = true
end
-- altrimenti errore
else
error( "Unknown Head")
end
EMC.ERR = 0
end