Fanuc
M08No arguments. If the M goes in a block with a move, the instant it runs (before or after the travel) depends on the control and on the PLC, so when the timing matters it pays to write it in its own block.
We use technical and security cookies and, only if you accept, analytics with no cross-site tracking. More in the Cookie policy and Privacy policy.
We use first-party cookies and technical storage to make the site work, Google reCAPTCHA security technology and, only if you accept, Vercel analytics (no cookies, no cross-site tracking). You can accept or reject analytics; both options are equivalent and you can change your choice at any time. More info: Cookie policy, Privacy policy, Legal notice and Terms and conditions.
M08 opens the machine coolant, which on almost every machine is the flood of cutting fluid, and M09 shuts it. They are among the simplest codes there are and, at the same time, among the ones that cause the most trouble when they are missing: a forgotten M09 before the tool change sends coolant into the magazine and into the taper of the next tool, and a forgotten M08 leaves a deep drill working dry. M09 shuts every coolant output at once, the mist of M07 included.
For reference only: syntax changes with the control, the post-processor and the machine parameters. Check the official manual and run a simulation before cutting. Legal notice.
Fanuc
M08No arguments. If the M goes in a block with a move, the instant it runs (before or after the travel) depends on the control and on the PLC, so when the timing matters it pays to write it in its own block.
Haas
M08Same as Fanuc. Haas warns when the tank level is low and lets the coolant be locked out from the panel: if the operator has disabled it, the M08 in the program opens nothing and the cycle carries on as if nothing had happened.
Siemens 840D / 828D
M8Written with no leading zero. As with the rest of the machine M codes, what each output opens is defined by the builder in the PLC; M8 and M7 are the two circuits the standard provides for.
Heidenhain TNC (Klartext)
M8M8 opens and M9 closes. On many TNCs the coolant can also be tied to each tool from the table, so it opens on the tool call without writing the M in the program.
Through-spindle coolant
M88 (ejemplo de Haas)High pressure internal coolant is not M08: on Haas it is opened with M88 and closed with M89, and other builders use their own numbers. A long drill with coolant holes needs that circuit, not the external flood.
| Letter | What it sets | Unit |
|---|---|---|
| No address letters | M08 and M09 take no arguments. Flow, pressure and nozzle aim are set on the machine, not in the program. | no units |
| M07 | The other coolant output, normally mist or air. It is opened separately, but it shares its shutdown with M08: the M09 closes both. | no units |
| Timing within the block | Not a letter, but worth bearing in mind: in a block with a move, some controls run the M as the travel starts and others as it ends. | depends on the control |
| G04 P (associated dwell) | A dwell put in after the M08 to give the pump time to build pressure before the tool goes into the material. | ms on Fanuc, seconds with decimals on Haas |
Drilling a 10 mm hole 60 mm deep in steel: six diameters, so it runs with a G83 peck cycle and plenty of coolant. The example shows the three places where coolant matters: before going in, during the pecking and, above all, before coming up to the tool change position.
O0008 (TALADRADO PROFUNDO CON REFRIGERANTE) | ( Program header. ) |
G21 G17 G40 G49 G80 | ( Millimeters, XY plane and a clean state. ) |
G91 G28 Z0. | ( Z to the reference point in incremental before the change. ) |
T6 M06 (BROCA D10) | ( 10 mm drill. ) |
G90 G54 G00 X50. Y40. S1400 M03 | ( Absolute, work offset, positioning over the hole and spindle on. ) |
G43 H06 Z50. | ( T6 length offset. ) |
M08 | ( Opens the flood with the tool still up and in its own block, so the pump has time to build pressure. ) |
G04 P1000 | ( One second of dwell. The pump does not give flow instantly and the first peck is what decides whether the chips come out or pack down the hole. ) |
G99 G83 Z-62. R3. Q8. F120 | ( Pecking 8 mm at a time, coming out to the R plane on each one. The coolant does two jobs here: cooling the edge and dragging the chips out. ) |
G80 G00 Z50. | ( Cancels the cycle and retracts in Z. ) |
M09 | ( Shuts the coolant before going up to the reference point. Left open, the nozzle waters the carousel and the fluid ends up inside the taper of the next tool. ) |
G91 G28 Z0. M05 | ( Z to the reference point and spindle stop, with the machine already dry. ) |
G90 M30 | ( Back to absolute and end. Whether the M30 shuts the coolant off by itself depends on the machine: do not count on it. ) |
Coolant is compulsory when chips have to come out of an enclosed place or temperature has to be held: deep drilling, reaming, tapping, turning stainless, finish passes with a tight tolerance where the part expanding shows up. It gets in the way in milling with carbide inserts in an interrupted cut, where the edge goes in and out of the material and the thermal shock between hot and cold cracks the coating: there air or consistent dry is better. Gray cast iron has always been machined dry, and aluminum works just as well on mist for plenty of jobs.
The M08 goes after the positioning and the length offset, with the tool still up, and in its own block if the flow takes time to arrive. The M09 goes before the final retract and always before the tool change, along with the G80, the G40 and the M05 of the transition block. That order is not cosmetic: the M09 before going up to the reference point is what keeps cutting fluid out of the tool magazine. At the end of the program, write it even though the M30 might shut it off, because that depends on the machine.
The code is a switch and nothing else. It does not set flow or pressure, it does not aim the nozzles, it does not know how much fluid is left in the tank or what concentration it is at. It cannot beat the panel lockout either: if the operator has disabled the coolant at the machine, the whole program runs believing it is open. That is why, when a burned tool shows up in a run that was going well, the first thing to look at is level, concentration and where the nozzles are pointing, since they move when you change to a much longer or shorter tool.
Yes, and it is what many post processors do, for example G00 Z2. M08. The one thing to know is that the exact instant the output switches on inside the block depends on the control. When you want to be sure the flood is on before the tool comes down, write it in its own block and add a short dwell.
Yes. M09 is the general coolant off: it closes every output the builder has tied to that function, flood and mist included. There is no separate off code for each one in the standard.
Normally yes: M30, M02 and reset usually cut the coolant. But that is decided by the builder in the PLC and there are machines where it does not happen. Writing the M09 in the closing block costs nothing and works everywhere.
With different codes: on Haas they are M88 to open and M89 to close, and every builder has its own. The internal circuit is what long drills with coolant holes need, and confusing it with the external flood leaves the tool without the flow that does the work.
In plenty of cases yes, and sometimes it is better. Gray cast iron has always been machined dry, coated carbide milling in an interrupted cut prefers dry or air, and a lot of aluminum is worked on mist. What is not open to debate is deep drilling, reaming and tapping: there you need flow.
CNC IDE: editing with G/M tooltips, line inspector, conversion between controls and 2D/3D toolpath.
CNC Alarms and Solutions Guide. Enter the error code or symptom to find the cause and how to repair it at the machine.
Estimate CNC turning and milling cycle time from G-code. Calculate parts per hour with a breakdown of cutting, rapids, canned cycles and tool changes.