Hi,
you should attempt to use the signal library instead.
If you wish to use the PLC script it will still work.
Have a close look at the API you are using:
LUA Syntax:
rc = mc.mcCntlGotoZero(
number mInst)
Description:
Move the X,Y,A,B,C and then the Z axis to zero of the current fixture offset.
Parameters: Parameter Description
mInst The controller instance.
Returns: Return Code Description
MERROR_NOERROR No Error.
MERROR_INVALID_INSTANCE The mInst parameter was out of range.
MERROR_NOT_NOW The operation could not be completed at this time.
Note in particular the return codes. Alter you code to test the return code. I will almost guarantee that the machine
is not in 'idle' state and cannot therefore GoToWorkZero because its busy.
local rc=mc.mcCntlGotoZero(inst)
if (rc== -180 then
wx.wxMessageBox('Machine not in idle state')
do return end
end
Note that if you use the SigLib{} approach you avoid this difficulty because the GoToWorkZero() function is
in the Screen script and does not have to switch chunks as your approach does.
Try wx4.set, it is way more complete/developed.
Craig