Professional Documents
Culture Documents
Alphabetic & Special Address Codes: Code Meaning
Alphabetic & Special Address Codes: Code Meaning
Every letter of the alphabet is used as a machine address code. In fact, some are used more than once, and their
meaning changes based on which G-code appears in the same block.
Codes are either modal, which means they remain in effect until cancelled or changed, or non-modal, which means
they are effective only in the current block.
Code Meaning
F Feed rate.
N Block Number.
O Program Number.
P Dwell time.
T Tool number.
X X-coordinate.
Y Y-coordinate.
Z-coordinate.
Z
F - Feed Rate
Sets the feed rate when machining lines, arcs or drill cycles. Feed rate can be in Inches per Minute (G94 mode) or
Inverse Time (G93 mode). Feed rates can be up to three decimal places accuracy (for tap cycles) and require a
decimal point.
G1 X1. Y0. F18.
G - Preparatory Code
Always accompanied by an integer that determines its meaning. Most G-codes are modal. Expanded definitions of
G-codes appear in the next section of this chapter.
G2 X1. Y1. I.25 J0.
M - Preparatory Code
Always accompanied by an integer that determines its meaning. Only one M-code is allowed in each block of code.
Expanded definitions of M-codes appear later in this chapter.
M8
N - Block Number
Block numbers can make the CNC program easier to read. They are seldom required for CAD/CAM generated
programs with no subprograms. Because they take up control memory most 3D programs do not use block
numbers. Block numbers are integers up to five characters long with no decimal point. They cannot appear before
the tape start/end character (%) and usually do not appear before a comment only block.
N100 T2 M6
O - Program Number
Programs are stored on the control by their program number. This is an integer that is preceded by the letter O
and has no decimal places.
O0002 (PROJECT 1)
P - Delay
Dwell (delay) in seconds. Accompanied by G4 unless used within certain drill cycles.
G4 P.1
S - Spindle Speed
Spindle speed in revolutions per minute (RPM). It is an integer value with no decimal, and always used in
conjunction with M3 (Spindle on CW) or M4 (Spindle on CCW).
S3820 M3
T - Tool number
Selects tool. It is an integer value always accompanied by M6 (tool change code).
T1 M6
X - X-Coordinate
Coordinate data for the X-axis. Up to four places after the decimal are allowed and trailing zeros are not used.
Coordinates are modal, so there is no need to repeat them in subsequent blocks if they do not change.
G1 X1.1252
Y - Y-Coordinate
Coordinate data for the Y-axis.
G1 Y1.
Z - Z-Coordinate
Coordinate data for the Z-axis.
G1 Z-.125
( ) - Comments
Comments to the operator must be all caps and enclosed within brackets. The maximum length of a comment is 40
characters and all characters are capitalized.
(T2: .375 END MILL)
/ - Block Delete
Codes after this character are ignored if the Block Delete switch on the control is on.
/ M0
; - End of Block
This character is not visible when the CNC program is read in a text editor (carriage return), but does appear at the
end of every block of code when the program is displayed on the machine control.
N8 Z0.1 ;