I also tried this, in the main screen script, but I am getting a compilation error on the messagebox line.
-- Spin CW function.
---------------------------------------------------------------
function SpinCW()
local sigh = mc.mcSignalGetHandle(inst, mc.OSIG_SPINDLEON);
local sigState = mc.mcSignalGetState(sigh);
local spindlerpm = mc.mcSpindleGetCommandRPM(inst);
if (sigState == 1) then
mc.mcSpindleSetDirection(inst, 0);
mc.mcCntlToolChangeManual(inst, true); --This will pause the tool change here and wait for a press of cycle start to continue
wx.wxMessageBox('Set spindle RPM to' .. spindlerpm .. ); --message box with RPM to set
else
mc.mcSpindleSetDirection(inst, 1);
mc.mcCntlToolChangeManual(inst, true); --This will pause the tool change here and wait for a press of cycle start to continue
wx.wxMessageBox('Set spindle RPM to' .. spindlerpm .. ); --message box with RPM to set
end
end