Hello, scripting/ModBus question;
I have set up ModBus and I can see the values being written out in the diagnostics window. I have made the connection between the discrete input to an input signal in Mach4. Now, when I go to "signal wait" on the input it never seems to be available to the mc.mcSignalWait(...) call.
If I do this I can manually pause on the signal but its ugly...
local isig = mc.mcSignalGetHandle(inst, mc.ISIG_INPUT50)
local state = mc.mcSignalGetState(isig)
while mc.mcSignalGetState(isig) > 0.0
do
-- snore
end
So why doesn't this work?
rc = mc.mcSignalWait(inst, mc.ISIG_INPUT50, 0, 30) -- Wait 30 seconds for input 50 to go low
And, yes, I do put a wx.wxMilliSleep(25) to force Mach4 to see the next read from ModBus (which is disappointing but not unexpected) and it still doesn't seem to get the value.
And yes, I tried all this in reverse, waiting for it to go high.
Thanks for the help!