Hi Craig,
I didn't fix the signal glitch problem from VFD but i changed the code as follows so it works for me like this;
function m3();
local inst=mc.mcGetInstance();
mc.mcSpindleSetDirection(inst,mc.MC_SPINDLE_FWD);
wx.wxSleep(1)
mc.mcCntlSetLastError(inst,"m3 waiting");
local returncode=mc.mcSignalWait(inst,mc.ISIG_INPUT62,mc.WAIT_MODE_HIGH,10);
if (returncode==mc.MERROR_TIMED_OUT) then
mc.mcSpindleSetDirection(inst,mc.MC_SPINDLE_OFF);
mc.mcCntlSetLastError(inst,"spindle did not respond, cycle stop");
mc.mcCntlCycleStop(inst, 0);
else;
mc.mcCntlSetLastError(inst,"m3 at speed");
end;
end
if (mc.mcInEditor() == 1) then
m3()
end
i am not sure if this "mc.mcCntlCycleStop(inst, 0);" is the correct usage of it but it works fine like this.
this code jumps over the glitch problem by waiting for a second or so before checking the input62 so when spindle reaches the commanded rpm vfd turns on the input62 and code says "m3 at speed" and goes on to gcode.
Also in case of missing input62 HIGH, it says "spindle did not respond, cycle stop" and stops the gcode.
Regards,
Hakan