11
Mach4 Toolbox / Re: M6: how to add manual spindle RPM with tool change?
« on: October 04, 2018, 01:03:14 AM »
Thanks for that reference. I'm not trying to pass a parameter, just get normal M3 functionality with the addition of a popup window telling me what RPM to set.
After a couple hours of messing with this, I finally got it. Here's my M3 script. This seems so obvious now... learning a new programming language just takes a little patience I suppose.
After a couple hours of messing with this, I finally got it. Here's my M3 script. This seems so obvious now... learning a new programming language just takes a little patience I suppose.
Code: [Select]
function m3()
inst = mc.mcGetInstance()
commandrpm = mc.mcSpindleGetCommandRPM(inst)
mc.mcCntlSetLastError(inst, 'SpindleClockwise')
mc.mcSpindleSetDirection(inst, 1)
wx.wxMessageBox("Set spindle RPM to " .. tostring(commandrpm) .. "\nThen press Cycle Start to continue")
mc.mcCntlToolChangeManual(inst, true)
end
if (mc.mcInEditor() == 1) then
m3()
end