Hi,
I think in this case it may be even simpler than that.
I would put an entry in the signal library table for the signal ISIG_MOTION_INHIBIT which caused the machine to disable.
Some thing like this:
Code:
mc.ISIG_MOTION_INHIBIT]=function(state)
if (state==1) then
mc.mcCntlEnable(inst,0)
end
end,
Put that in SigLib near the top of the screen load script and your done!
If you put code into either the PLC or the PMC then that code runs every few milliseconds in the case of the PLC and even more frequently for the
PMC, but why....you only need to disable the machine WHEN the signal changes to high. That is exactly the purpose of the signal library table.
Its such an elegant and code efficient use of Lua's one and only data structure.
Craig