Hello all,
on my router I have a pneumatic dust hood. I have two M codes to activate and deactivate it in G code. Also in screen I've made a button so I can raise and lower it in the middle of the program if I want to. But there is a problem. When I start the program (any program that I have) dust hood is activated but then suddenly the output is deactivated in the middle of the program. Sometimes this happens after a minute, sometimes after 10 minutes. Then I have to push the button to activate it again. Any help would be appreciated.
Here is the codes:
function m101()
inst = mc.mcGetInstance()
local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
mc.mcSignalSetState(hSig, 1)
end
if (mc.mcInEditor() == 1) then
m101()
end
----------------------------------------------------
function m102()
inst = mc.mcGetInstance()
local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
mc.mcSignalSetState(hSig, 0)
end
if (mc.mcInEditor() == 1) then
m102()
end
-------------------------------------------------------
-- Dust hood button script
inst = mc.mcGetInstance()
local hSig, rc = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5)
local state, rc = mc.mcSignalGetState(hSig)
if state == 1 then
mc.mcSignalSetState(hSig, 0)
else
mc.mcSignalSetState(hSig, 1)
end
Regards,
Peter