The example script for input 1 will make input 1 do a cycle start when pressed and a feed hold when released (think dead man switch) if everything is uncommented.
[mc.ISIG_INPUT1] = function (state) --Anytime the state of input 1 changes, run this function
-- if (state == 1) then --Input one is active
-- CycleStart() --Run the CycleStart() function
-- --else --Input one is inactive
-- --mc.mcCntlFeedHold (0) --Do a feed hold
-- end
end,
If you want input 1 to only run the CycleStart function it should look like this........
[mc.ISIG_INPUT1] = function (state) --Anytime the state of input 1 changes, run this function
if (state == 1) then --Input one is active
CycleStart() --Run the CycleStart() function
--else --Input one is inactive
--mc.mcCntlFeedHold (0) --Do a feed hold
end
end,
I think you will find the following link helpful.
http://www.lua.org/manual/5.2/