M-Code/G-Code List

Below you will find a list of common codes many builders use. Please remember, all machines may be configured differently and the list below may not match your machine perfectly. If fact, virtually all M-Codes above M79 will vary from builder to builder. Please make sure to contact your machine tool builder to be sure.

Typical G Command for a Machining Center

Typical M Commands for a Machining Center

Typical MDI Commands

M06 T12; Performs a tool change to tool number 12
S1000 M03; Turns spindle on clockwise to 1000 rpm
G01 X10.5 F10.0: Moves the X axis to position 10.5 at a feedrate of 10.0

G00 X……. Y…….. Z…….. ;
G00 Move in rapid travel
X….. X axis address
Y….. Y axis address
Z….. Z axis address

G01 X……. Y…….. Z…….. F……. ;
G01 Move in a straight line
X….. X axis address
Y….. Y axis address
Z….. Z axis address
F….. Feedrate

G02 X……. Y…….. Z…….. I……. J…….. K…….. F……. ;
G02 Move along a clockwise circular path
X….. X axis address
Y….. Y axis address
Z….. Z axis address
I ….. I axis address
J….. J axis address
K….. K axis address
F….. Feedrate

G03 X……. Y…….. Z…….. I……. J…….. K…….. F……. ;
G03 Move along a counter-clockwise circular path
X….. X axis address
Y….. Y axis address
Z….. Z axis address
I ….. I axis address
J….. J axis addressK….. K axis address
F….. Feedrate

G04 X….… ;
G04 Pause machine operation
X….… ( Specify a time/spindle speed with decimal point)

G04 P….… ; ( Specify a time without decimal point)
G04 Pause machine operation
P….… ( Specify a time/spindle speed without decimal point)

G28 G90 X10.0 Y3.0 ;
G28 Return to reference point
G90 Absolute positioning
X10.0 X axis location
Y3.0 Y axis location

This command sequence can be used to move the tool from point A to an
ABSOLUTE Coordinate first, then move the tool to the Reference Point Zero.
G28 G91 X-4.0 Y-3.0 ;
G28 Return to reference point
G91 Incremental positioning
X-4.0 X axis location
Y-3.0 Y axis location

This command sequence can be used to make an incremental move from point A
then move the tool to the Reference Point Zero
G28 G91 X0.0 Y0.0 ;
This line will take the tool back to the reference position direct from the current
location.
G41 D…. X …… ;
G41 Cutter Comp Left
D….. Assigns Radius Offset number
X…. X axis movement

G42 D….… X …… ;
G42 Cutter Comp Right
D….. Assigns Radius Offset number
X…. X axis movement

G40 X….. ;
G40 Cancel Cutter Comp
X….. Cancels comp on way to Here

G43 H…. Z …… ;
G43 Add offset amount
H….. Offset number
Z…. Z axis movement

G44 H… Z …… ;
G44 Subtract offset amount
H….. Offset number
Z…. Z axis movement

G49 H….. Z…… ;
G49 Cancel Offset
H13 Assigns Offset Number 13
Z0.0 Z axis movement to Zero

G65 P……. L…….. ;
G65 Macro call (Modal)
P….. Macro program Number
L….. Number of repetitions

G66 P……. ;
G66 Macro call (Non-Modal)
P….. Macro program Number

G73 X……. Y…….. Z…….. R……. Q…….. F…….. K……. ;
G73 High speed peck drilling cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R ….. Retract plane
Q….. Distance for each peck stroke
F….. Feedrate
K….. Number of repeats

G74 X……. Y…….. Z…….. R……. P…….. F…….. K……. ;
G74 Left handed tapping cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R …. Retract plane
F….. Feedrate
K….. Number of repeats

G76 X……. Y…….. Z…….. R……. Q…….. P…….. F…….. K……. ;
G76 Fine boring cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R ….. Retract plane
Q….. Distance for each peck stroke
P….. Dwell time at bottom of bore
F….. Feedrate
K….. Number of repeats

G81 X……. Y…….. Z…….. R……. F…….. K……. ;
G81 Spot drilling cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R ….. Retract plane
F….. Feedrate
K….. Number of repeats

G82 X……. Y…….. Z…….. R……. P…….. F…….. K……. ;
G82 Drilling cycle counter boring cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R ….. Retract plane
P….. Dwell time at bottom of bore
F….. Feedrate
K….. Number of repeats

G83 X……. Y…….. Z…….. R……. Q…….. F…….. K……. ;
G83 Peck drilling cycle
X….. X axis address
Y….. Y axis address
Z….. Z address location of bottom of hole
R ….. Retract plane
Q….. Distance for each peck stroke
F….. Feedrate
K….. Number of repeats

Get your Fanuc CNC machine back up and running.

TIE offers same day shipping on more than 100,000 Fanuc CNC parts in stock. We offer a 1 year in service warranty on all parts and repairs.