232
« on: September 22, 2018, 10:56:47 AM »
Here are mine, M8 and M7, working from the screen start script Signal Library. You'd need to change the inputs, of course. I didn't compare to yours, but YOU can!
----------Mach4 Input 17 PoKeys Pin 17-----
----------Toggle Coolant M8----------------
[mc.ISIG_INPUT17] = function (state)
if (state == 1) then
local inst = mc.mcGetInstance();
local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_COOLANTON);
local sigState = mc.mcSignalGetState(sigh);
if (sigState == 0) then
local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
mc.mcSignalSetState(OSigCool,1)
mc.mcCntlSetLastError(inst, "Coolant On")
else
local OSigCool = mc.mcSignalGetHandle (inst,mc.OSIG_COOLANTON)
mc.mcSignalSetState(OSigCool,0)
mc.mcCntlSetLastError(inst, "Coolant Off")
end
end
end,
----------Mach4 Input 14 PoKeys Pin 14--
----------Toggle Mist M7----------------
[mc.ISIG_INPUT14] = function (state)
if (state == 1) then
local inst = mc.mcGetInstance();
local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_MISTON);
local sigState = mc.mcSignalGetState(sigh);
if (sigState == 0) then
local OSigMist = mc.mcSignalGetHandle (inst,mc.OSIG_MISTON)
mc.mcSignalSetState(OSigMist,1)
mc.mcCntlSetLastError(inst, "Mist On")
else
local OSigMist = mc.mcSignalGetHandle (inst,mc.OSIG_MISTON)
mc.mcSignalSetState(OSigMist,0)
mc.mcCntlSetLastError(inst, "Mist Off")
end
end
end,
Tom