# LinuxCNC M8

Instructions · `M8` · verification: source checked

M8 is a LinuxCNC M-code that turns flood coolant on. It does so by controlling the iocontrol.0.coolant-flood HAL pin, which must be connected in HAL before the command affects a physical output. M9 turns both mist (M7) and flood (M8) coolant off.

## Specification

| Property | Value |
|---|---|
| Language | gcode |
| Code | M8 |
| Group | Coolant Control |
| Syntax | M8 |
| Dialect | LinuxCNC |

## Study notes

- M8 controls the iocontrol.0.coolant-flood pin.
- M7 controls the iocontrol.0.coolant-mist pin.
- M9 turns both M7 and M8 off.
- One or both coolant control pins must be connected in HAL before M7 or M8 will control an output; M7 and M8 can be used to turn on any output via G-code.
- It is OK to use M7, M8 or M9 regardless of the current coolant state.
- M2/M30 program end turns coolant off like M9.
- M70 saves mist (M7) and flood (M8) status as part of modal state.

## Sources

1. [M-Codes](https://linuxcnc.org/docs/html/gcode/m-code.html#mcode:m7-m8-m9) (accessed 2026-10-26)

---

Source page: https://machineschema.com/instruction/mcode-m08  
JSON: https://machineschema.com/instruction/mcode-m08.json  
License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Cite Machine Schema and the original sources.
