Hi,
your post would get more readers if in the Mach4 board...
I would use Mach4 signals....
hReg = mc.mcIoGetHandle(inst, mc.ISIG_INPUT1)
gets the handle of an IO whereas mc.ISIG_INPUT1 is a Mach4 signal...
hReg=mc.mcSignalGetHandle(inst,mc.ISIG_INPUT1)
if hReg == 1 then
tests the handle not the state of the signal. It is a good idea to test the handle to make sure its valid, if you try
to read the state of the signal at the handle address and the handle is invalid Mach will crash. If you do test it, it is assumed valid if NOT zero...
if hReg =! 0 then
Assuming the handle is good now read the state of the signal....
SignalState,rc=mc.mcSignalGetSate(hReg)
Remember that a 'handle' is a numerical address of an IO or Signal or Register in Mach. While IO, Signals and Registers may have useful names, numbers
or paths they must be reduced to a numerical address, a handle, before you can access them.
Craig