Hi,
I'm not sure that this will prove directly useful but I helped another bloke with a similar sort of situation with it:
LUA Syntax:
rc = mc.mcSignalWait(
number mInst,
number sigId,
number waitMode,
number timeoutSecs);
I'll try to find the original post but there is a couple of things that are worth highlighting:
1) You don't need the signal HANDLE, just its ID, in your case mc.ISIG_INPUT18
2) While there are nearly two hundred input signals defined in Mach4 only the first 64 signals work with this API...mc.ISIG_INPUT0 thru mc.ISIG_INPUT63
3) There are a number of return codes, it is very easy to miss the fact that under a particular circumstance an unexpected return code can be generated
and your code seems to fail for no reason. I suffered quite a few failures of this type while developing code which worked correctly. It is worthwhile
to code a 'trap and message' for those codes that while you don't expect them may well show up from time to time. It may well be that your completed code
is robust without such a precaution, but including such traps during development can save some hair pulling!
Craig