Hi,
OK that's easy enough. What you need to do is insert a 'wait on signal' macro immediately after each
move that requires it.
That can be done as a macro. So open the script editor and open a new document but save it in your macros folder
of your current profile m199.mcs
This is the code:
function m199()
local inst=mc.mcGetInstance()
local rc=mc.mcSignalWait(inst,mc.ISIG_INPUT4,mc.WAIT_MODE_HIGH,10)
if (rc==mc.MERROR_TIMED_OUT) then
mc.mcCntlSetLastError(inst,'Timed Out')
return
end
end
if (mc.mcInEditor()==1)then
m199()
end
I have used this API (API.chm):
LUA Syntax:
rc = mc.mcSignalWait(
number mInst,
number sigId,
number waitMode,
number timeoutSecs);
Description:
Wait on a signal to change state.
Parameters: Parameter Description
mInst The controller instance.
sigId A valid signal ID. (NOT a signal handle)
waitMode An integer specifying whether to wait on the signal to go high (WAIT_MODE_HIGH) or low (WAIT_MODE_LOW).
timeoutSecs A double specifying a timeout period.
So in the code I have posted there is a 10 second TimedOut period while it waits for ISIG_INPUT4 to go high.
Craig