121
Mach4 General Discussion / Re: Lua
« on: January 07, 2017, 01:11:57 AM »
You need something like this I am not sure if this is the correct way to do it now
Code: [Select]
SignalTable = {001,
[mc.ISIG_INPUT0] = function (on_off)
if (on_off == 1) then
mc.mcCntlCycleStart(inst)
end
end
}
SignalTable = {002,
[mc.ISIG_INPUT1] = function (on_off)
if (on_off == 1) then
mc.mcCntlCycleStop(inst)
end
end
}
SignalTable = {003,
[mc.ISIG_INPUT2] = function (on_off)
if (on_off == 1) then
mc.mcCntlReset(inst)
end
end
}
SignalTable = {004,
[mc.ISIG_INPUT3] = function (on_off)
if (on_off == 1) then
mc.mcCntlFeedHold(inst)
end
end
}
------------------------------------------------------------------------
if (SignalTable[001] ~= nil) then
SignalTable[sig](state)
end
if (SignalTable[002] ~= nil) then
SignalTable[sig](state)
end
if (SignalTable[003] ~= nil) then
SignalTable[sig](state)
end
if (SignalTable[004] ~= nil) then
SignalTable[sig](state)
end