You CAN create a M30 macro. If you do, it will REPLACE the stock M30 functions. So when you write it, you will need to put any of the original functionality of the stock M30 into the custom M30 macro.
The stock actions for M30 in mill are:
1. Stop the spindle.
2. Turn off cutter comp.
3. Turn off mist.
4. Turn off flood.
5. End processing (Cycle Stop).
6. Rewind.
Note: #5 and #6 are preformed even if a custom M30 macro exists. The entire custom M30 macro will be executed and then #5, followed by #6, will be executed.
function m30()
local inst = mc.mcGetInstance()
mc.mcCntlSetLastError(inst, "This is my m30 macro")
end
if (mc.mcInEditor() == 1) then
m30()
end
If you used that file, when G code calls M30, it will simply print they message, end processing, rewind, and do NOTHING else.
So, to recap:
1. If the m30.mcs macro exists in the macros directory, it will be used in lieu of the stock M30 actions.
2. If a custom M30 macro is used, it must include all of the functionality you wish as none of the stock M30 actions will be performed otherwise except for Cycle Stop and Rewind.
Steve