LinuxCNC M7

M7 is a LinuxCNC G-code M-code that turns mist coolant on. It drives the HAL pin iocontrol.0.coolant-mist, which must be connected in the HAL configuration before the command will control an output. The command may be issued regardless of the current coolant state, and M9 turns both mist (M7) and flood (M8) coolant off.

Source checked2/2 values · 2026-10-26

Specification

1 source
Languagegcode
CodeM7
Groupcoolant control
DialectLinuxCNC

Study notes

  • M7 controls the iocontrol.0.coolant-mist pin.
  • M8 controls flood coolant via iocontrol.0.coolant-flood; 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.
  • Any of M7, M8 or M9 may be used regardless of the current coolant state.
  • Program end (M2/M30) turns coolant off like M9.
  • M70 saves mist (M7) and flood (M8) status as part of modal state; M72 restores it.

Safety

  • Coolant continues to flow during a tool change (M6) unless it has been turned off with M9.
↑↓ navigate↵ openesc close