M-code overview – Smithy CNC Mills User Manual
Page 38

SmithyCNC Programmer’s Reference Manual:M Codes
SmithyCNC Programmer’s Reference Manual: M-Codes
3-2
M-CODE OVERVIEW
In addition to the G-Codes, there is a set of M-Codes (miscellaneous codes) that
are used to to control your machine tool and its auxillary functions.
3.1 M0, M1, M2, M30, M60: Program Stopping and Ending
To stop a running program temporarily (regardless of the setting of the optional
stop switch), program M0.
To stop a running program temporarily (but only if the optional stop switch is
on), program M1.
It is OK to program M0 and M1 in MDI mode, but the effect will probably not be
noticeable, because normal behavior in MDI mode is to stop after each line of
input, anyway.
To exchange pallet shuttles and then stop a running program temporarily
(regardless of the setting of the optional stop switch), program M60.
If a program is stopped by an M0, M1, or M60, pressing the cycle start button
will restart the program at the following line.
To end a program, program M2. To exchange pallet shuttles and then end a pro-
gram, program M30. Both of these commands have the following effects.
1. Axis offsets are set to zero (like G92.2) and origin offsets are set to the
default (like G54).
2. Selected plane is set to CANON_PLANE_XY (like G17).
3. Distance mode is set to MODE_ABSOLUTE (like G90).
4. Feed rate mode is set to UNITS_PER_MINUTE (like G94).
5. Feed and speed overrides are set to ON (like M48).
6. Cutter compensation is turned off (like G40).
7. The spindle is stopped (like M5).
8. The current motion mode is set to G_1 (like G1).