Professional Documents
Culture Documents
Understanding The Programmable Language of CNC - G and M Codes - (AGDAMAG)
Understanding The Programmable Language of CNC - G and M Codes - (AGDAMAG)
Sub-Topic #1: Complete list of G-codes commands for Milling Operation, its category,
description/function, and Corollary Info:
Content:
Many G and M codes cause the system to switch modes, and the mode remains active until
another command, implicitly or explicitly, changes it. Such commands are referred to as "modal."
Modal commands are organized into "modal groups," which are collections of commands. At any
given time, only one member of a modal group can be active. A modal group is a collection of
commands for which it is logically impossible for two members to be active at the same time.
The difference between measuring in inches and millimeters is modal. A machine tool can be in
multiple modes at once, with one mode from each group active.
{G0, G1, G2, G3, G80, G81, G82, G83, G84, G85,
Group 1
G86, G87, G88, G89} - motion
Group 2 {G17, G18, G19} - plane selection
Group 3 {G90, G91} - distance mode
Group 5 {G93, G94} - spindle speed mode
Group 6 {G20, G21} - units
Group 7 {G40, G41, G42} - cutter diameter compensation
Group 8 {G43, G49} - tool length offset
Group 10 {G98, G99} - return mode in canned cycles
{G54, G55, G56, G57, G58, G59, G59.1, G59.2,
Group 12
G59.3} coordinate system selection
Group 2 {M26, M27} - axis clamping
Group 4 {M0, M1, M2, M30, M60} - stopping
Group 6 {M6} - tool change
Group 7 {M3, M4, M5} - spindle turning
Group 8 {M7, M8, M9} - coolant
Group 9 {M48, M49} - feed and speed override bypass
J Defines arc size in Y axis for G02 For arc moves (G2/G3), this is the
or G03 arc commands. incremental Y-distance from the arc start
point to the arc center. Certain drill cycles
also use J as an optional parameter.
Also used as a parameter within G02 X.5 Y2.500 I0.J0.250
some fixed cycles.
The following is a list of commonly used special characters, along with their definitions, applications, and
limitations.
All programs start and end with a single percent on a single block. A tape rewind character is the name of
this code (a holdover from the days when programs were loaded using paper tapes).
( )– Comments
All comments to the operator must be written in capital letters and wrapped in brackets. A comment can
be up to 40 characters long, with all characters capitalized.
/ – Block Delete
If the Block Delete switch on the control is turned on, codes after this character are ignored.
M00/
; – End of block
When reading the CNC program in a text editor (carriage return), this character is not visible, but it
appears at the conclusion of every block of code when the program is presented on the machine control.
N8 Z0.750 ;