CNC Z32 - Programming Guide (LATHES)
2.3 M
Functions
The M functions (miscellaneous) are mainly related to the machine tool behavior and their functionality is mostly
defined by the machine tool builder.
All M functions require a machine stop.
The ISO standards indicate the functionality of many M codes: only some M codes are decoded and managed by
the Z32, and only these codes will be discussed.
The numeric value (two integer digits) following the letter “M”, indicates the programmed M function. All leading
zeros can be omitted (G0 = G00).
ISO “M” codes
M0 - stop
It stops the program execution; program resuming trough Start pushbutton. This function also stops
spindle and coolants.
M1 – conditioned stop
Same behavior as M0, but M1 activity is conditioned by a dedicated logic input: for further details, please
consult the machine tool builder. This function also stops spindle and coolants.
M2 – End of program
Exits the control EXECUTION mode and terminates all automatic operations.
M3 – Spindle clockwise
Requests a clockwise rotation of the spindle, with the previously programmed S (speed).
M3 – Spindle counterclockwise
Requests a counterclockwise rotation of the spindle, with the previously programmed S (speed).
M5 – Spindle stop
Requests the spindle stop. It stops also the coolants.
M6 – Tool change
Requests the mounting of last programmed T (in the same or preceding blocks) on the spindle. It also
stops spindle and coolants. After the M6 execution, the NC takes into account the description of the tool
mounted on the spindle, updating accordingly all parameters.
M7 – coolant #1 delivery
Requests delivery of coolant #1.
M8 – coolant #2 delivery
Requests delivery of coolant #2.
M9 – Coolant stop
Requests stop of coolants delivery.
M19 – Spindle orientation
Requests the spindle orientation.
This function also stops spindle and coolants.
The machine tool builder can define other M functions for particular usage and purposes of the machine. For
further details, please consult the machine tool builder.
Special “M” codes
A category of M functions is defined as “Special” M. Unlike normal M functions, interpreted exclusively by the
machine PLC, every special M code is associated with a service part-program. A typical example of special M is
the M6 for tool changing.
The definition and programming of subprograms associated with special M codes, are activities reserved to the
machine tool builder.
During the execution of the subprogram associated to a special M, the progressive block number counting is
suspended (in block search the special M appears as a single block, not searchable in an intermediate point).
The subprogram associated to the special M may be executed as a single block.
6