Author: Site Editor Publish Time: 2025-08-04 Origin: Site
The CNC machining center code collection refers to the instruction set used to control the operation of a CNC machining center (a type of numerical control machine tool). These codes are usually composed of letters and numbers, and each code has a specific meaning and function. Next, the editor of Huaya CNC will share with you the meanings and functions of G codes and M codes for CNC machining centers:
G Code (Preparation Function)
G-code is used to set the preparation functions of machine tools, such as tool path control, coordinate system selection, tool compensation, feed rate and spindle speed, etc. The following are some common G-codes and their functions:
'G00' : Quick Positioning command, enabling the tool to move to the designated position at the fastest speed.
'G01' : Linear interpolation command, moving the tool according to the set feed rate.
'G02' : Clockwise circular interpolation command.
'G03' : Counterclockwise circular interpolation command.
'G04' : Pause command, causing the tool to pause at the designated position for a specific period of time.
'G09' : Precise stop command, checking whether the tool position conforms to the preset tolerance range.
'G17' : Select the XY plane as the working plane.
'G18' : Select the XZ plane as the working plane.
'G19' : Select the YZ plane as the working plane.
'G20' : Set the input in inches.
'G21' : Set the input in millimeters.
'G28' : Returns the reference point detection command.
"G40" : Eliminate tool radius compensation.
'G41' : Enable left tool radius compensation.
'G42' : Enable right tool radius compensation.
"G43" : Tool length compensation + direction.
'G44' : Tool length compensation - direction.
'G49' : Cancel tool length compensation.
"G90" : Absolute Programming Mode.
"G91" : Incremental Programming mode.
"M Code (Accessibility)
The M code is used to control the auxiliary functions of the machine tool, such as tool changing, coolant control, spindle start and stop, etc. The following are some common M codes and their functions:
'M00' : The program stops unconditionally.
'M01' : Program condition stops.
'M02' : Program ends.
'M03' : The main shaft is rotating in the forward direction.
'M04' : Spindle reversal.
'M05' : Spindle stops.
'M06' : Tool exchange.
'M08' : The coolant is turned on.
'M09' : Coolant off.
'M30' : The program ends and returns to the beginning.
'M98' : Call the subroutine.
'M99' : The subroutine ends and returns to the main program.
The specific application and combination of these codes will determine the operation process and processing effect of the CNC machining center. When programming, programmers need to use these codes reasonably according to the processing requirements and the characteristics of the machine tool.