Midwest Metal Fabrications
Metal Services
Laser Cutting
Press Breaking
Welding
CNC Shearing
Metal Finishing
CNC Machining
Metal Products
NEMA Enclosures
Metal Enclosures & Racks
Custom Bollards & Guards
Weldments
Resources
Glossary
News
About
Receive Free Quote

M-Code

Home > Glossary > CNC Machining > M-Code

Machine function codes in CNC programming that control auxiliary operations including spindle on/off, coolant on/off, tool changes, pallet changes, and program stop. M-codes work in conjunction with G-codes to execute a complete machining sequence.

M-codes are auxiliary function commands in CNC programming that control machine-level operations like spindle on/off, spindle direction (clockwise or counterclockwise), coolant activation, tool changes, and program stop/pause functions. Common M-codes include M03 (spindle on clockwise), M05 (spindle off), M08 (coolant on), M09 (coolant off), and M06 (tool change), each serving a specific purpose in the machining sequence.

M-codes work in conjunction with G-codes to execute a complete machining program, G-codes command motion and cutting, while M-codes orchestrate spindle speed changes, tool swaps, and auxiliary functions. Modern CNC controllers can also respond to programmable M-codes (M100-M199 range) that trigger custom machine-specific functions, such as parts unloading systems or pallet changes on automated machines.

Proper sequencing of M-codes is critical for safety and efficiency; for example, the spindle must always be stopped (M05) before a tool change (M06), and coolant should be turned off before the part is unloaded to prevent spillage.

Glossary Term Categories

Laser Cutting
Press Braking
Welding
CNC Shearing
Metal Finishing
CNC Machining
NEMA Enclosures
Weldments, Bollards & Guards

Price Your Project

Receive a free, custom quote for you project. Midwest Metal Fabrications can handle any job, small or large and is ISO 9001:2015 and AS9100 Certified.

Receive a Free Quote
Midwest Metal Fabrications
516 Commerce St.
Tallmadge, OH 44278
(330) 633-0191
Hours
Monday to Friday
6:00 AM - 4:00 PM EST
Services
All ServicesLaser CuttingPress BreakingWeldingCNC Shear & SawMetal FinishingCNC Machining
Service AREAS
AkronCantonClevelandCuyahoga FallsHudsonStow
METAL Products
NEMA EnclosuresMetal Enclosures and RacksCustom Bollards and GuardsWeldments
Resources
Glossary of TermsNews
Legal
Privacy Policy
Company
About UsCareersNewsContact
© xxxx Midwest Metal Fabrications. All rights reserved.
Site by Onboard Creative