Fusion Post generates M30. Controller wants M2

Is there a way to update the post-processor to generate an M2 rather than M30 code at the end of the .nc file out of Fusion 360?

M30 restarts the program and I have been going in manually changing it to M2. Not a big deal just hoping I could change it either on the controller or in the post processor.

Either way, I’m digging this machine. I’ve only drilled and chamfered holes in my table for threaded inserts so far and it is so much fun.


You can edit the post processor yourself, but according to wiki M2 is obsolete, and M30 is the replacement?

G-code - Wikipedia

To edit, click the pencil from your NC Program config,

In the post processor code you will find something like,

function onClose() {


  setWorkPlane(new Vector(0, 0, 0)); // reset working plane

  writeRetract(X, Y);

  writeBlock(mFormat.format(30)); // stop program, spindle stop, coolant off

The line you want to change is this one,

  writeBlock(mFormat.format(30)); // stop program, spindle stop, coolant off

Thank you. I looked in the controller settings and it looks like the Buildbotics looks for an M2. The first program I ran restarted itself and it was a close call.


Will there be an issue if I change this from M2 to M30 in the g code settings (OF controller)

According my research, the pure use of M2 is to end the program, and M30 is to end the program and reset the program to the beginning. It should not re-run the program though - only prepare it to be re-run.

I don’t think sending M2 or M30 twice would hurt anything, but I’ve not tried it.


1 Like