M Codes
168
96-8000 rev R June 2007
M19 Orient Spindle (P and R values are an optional feature)
The M19 code is used to adjust the spindle to a fixed position.
The spindle will only orient to the zero position without the optional M19 spindle orient feature
The optional Orient Spindle function allows P and R address codes. For example, M19 P270 will orient the spindle
to 270 degrees. The R-value allows the programmer to specify up to four decimal places, for example, M19
R123.4567.
M21-M28 Optional User M Function with M-Fin
The M codes M21 through M28 are optional for user relays; each M code will activate one of the optional relays.
The Reset button will terminate any operation that is waiting for a relay-activated accessory to finish. Also see
M51-58 and M61-68.
Some or all of the M21-25 (M21-M22 on Toolroom, Office and Mini mills) on the I/O PCB may be used for factory-
installed options. Inspect the relays for existing wires to determine which have been used. Contact the Haas factory
for more details.
M-Code Relays
These outputs can be used to activate probes, auxiliary pumps or clamping devices etc. The auxiliary
devices are electrically connected to the terminal strip for the individual relay. The terminal strip has a
position for, Normally Open (NO), Normally Closed (NC) and Common (COM).
K8 K1
M21M25 M22M26 M23
M27
M24M28
NO NCCOM
121110987654321 121110987654321
NO NCCOM
P8
P4
Main I/O PCB M-Code Relays Optional M-Code Relay Board
(Mounted above main I/O PCB)
Optional 8M-Code Relays
Additional M-Code relay functions can be purchased in banks of 8. A maximum of two 8M-code relay
boards can be installed in the machine, for a total of 16 additional outputs.
A total of 4 banks of 8 relays are possible in the Haas system these are numbered from 0-3. Banks 0 and
1 are internal to the main I/O PCB. Bank 1 includes the M21-25 relays at the top of the IOPCB. Bank 2
addresses the first 8M option PCB. Bank 3 addresses the second 8M option PCB.
NOTE: Bank 3 may be used for some Haas installed options and may not be available.
Contact the Haas factory for more details.
Only one bank of outputs may be addressable with M-codes at a time. This is controlled by parameter 352
“Relay Bank Select”. Relays in the non-activated banks are only accessible with macro variables or M59/
69. Parameter 352 is shipped set to “1” as standard.
NOTE: With any probing option, Parameter 352 must be set to ‘1’. When the 8M option
is installed, access its relays using M59/69
M30 Program End and Reset
The M30 code is used to stop a program. It stops the spindle and turns off the coolant (including TSC) and the
program cursor will return to the start of the program. M30 cancels tool length offsets.