Hi,
this is some code I have written, as I suggested to you I have written it in a temporary folder. It compiles OK and I have
single stepped through it with the debugger and it appears to work.
May I suggest copying this into your temporary folder and step through it with the debugger. Once you are happy with it THEN
copy it into the PLC script.
local inst=mc.mcGetInstance()
local xhomed,rc=mc.mcAxisIsHomed(inst,mc.X_AXIS)
local yhomed,rc=mc.mcAxisIsHomed(inst,mc.Y_AXIS)
local zhomed,rc=mc.mcAxisIsHomed(inst,mc.Z_AXIS)
local outhandle=mc.mcSignalGetHandle(inst,mc.OSIG_OUTPUT5)
if (xhomed==1 and yhomed==1 and zhomed==1) then
mc.mcSignalSetState(outhandle,1)
else
mc.mcSignalSetState(outhandle,0)
end
Craig