M-code are cnc program instructions which help cnc machinist/programmer to control cnc machine hardware like chuck, tailstock, quill, coolant. Here are listed M-code which are mostly used on cnc lathe/mill with Fanuc cnc control.
Fanuc M-Code List (Lathe)
| M code | Description |
|---|---|
| M00 | Program stop |
| M01 | Optional program stop |
| M02 | End of program |
| M03 | Spindle start forward CW |
| M04 | Spindle start reverse CCW |
| M05 | Spindle stop |
| M08 | Coolant on |
| M09 | Coolant off |
| M29 | Rigid tap mode |
| M30 | End of program reset |
| M40 | Spindle gear at middle |
| M41 | Low Gear Select |
| M42 | High Gear Select |
| M68 | Hydraulic chuck close |
| M69 | Hydraulic chuck open |
| M78 | Tailstock advancing |
| M79 | Tailstock reversing |
| M94 | Mirrorimage cancel |
| M95 | Mirrorimage of X axis |
| M98 | Subprogram call |
| M99 | End of subprogram |
Fanuc M-Code List (Mill)
| M code | Description |
|---|---|
| M00 | Program stop |
| M01 | Optional program stop |
| M02 | End of program |
| M03 | Spindle start forward CW |
| M04 | Spindle start reverse CCW |
| M05 | Spindle stop |
| M06 | Tool change |
| M07 | Coolant ON – Mist coolant/Coolant thru spindle |
| M08 | Coolant ON – Flood coolant |
| M09 | Coolant OFF |
| M19 | Spindle orientation |
| M28 | Return to origin |
| M29 | Rigid tap |
| M30 | End of program (Reset) |
| M41 | Low gear select |
| M42 | High gear select |
| M94 | Cancel mirrorimage |
| M95 | Mirrorimage of X axis |
| M96 | Mirrorimage of Y axis |
| M98 | Subprogram call |
| M99 | End of subprogram |