Hi,
function m4();
local inst=mc.mcGetInstance();
mc.mcSpindleSetDirection(inst, mc.MC_SPINDLE_REV);
mc.mcCntlSetLastError(inst,"m4 waiting");
local returncode=mc.mcSignalWait(inst,mc.ISIG_SPINDLE_AT_SPEED,mc.WAIT_MODE_HIGH,10.0);
if (returncode==mc.MERROR_TIMED_OUT) then
mc.mcCntlSetLastError(inst,"spindle does not respond");
mc.mcSpindleSetDirection(inst,mc.MC_SPINDLE_OFF);
else;
mc.mcCntlSetLastError(inst,"m4 at speed");
end;
end
if (mc.mcInEditor() == 1) then
m4()
end
function m5();
local inst=mc.mcGetInstance();
mc.mcSpindleSetDirection(inst,mc.MC_SPINDLE_OFF);
mc.mcCntlSetLastError(inst,"m5 stopping");
local returncode=mc.mcSignalWait(inst,mc.ISIG_SPINDLE_AT_ZERO,mc.WAIT_MODE_HIGH,10.0);
if (returncode==mc.MERROR_TIMED_OUT) then
mc.mcCntlSetLastError(inst,"spindle does not respond");
mc.mcSpindleSetDirection(inst,mc.MC_SPINDLE_OFF);
else;
mc.mcCntlSetLastError(inst,"m5 is stopped");
end;
end
if (mc.mcInEditor() == 1) then
m5()
end
Craig