Professional Documents
Culture Documents
Vision: A premier Science and Technology university for the formation of world class and virtuous
human resource for sustainable development in Bohol and the Country.
Mission: BISU is committed to provide quality higher education in the arts and sciences, as well
as in the professional and technological fields; undertake research and development and
extension services for the sustainable development of Bohol and the country.
G - CODES
REGINA P. SOLLANO
BSME 5-A
G-code (also RS-274), which has many variants, is the common name for the most
widely used numerical control (NC) programming language. It is used mainly in computer-
aided manufacturing to control automated machine tools.
Implementations
During the 1970s through 1990s, many CNC machine tool builders attempted to
overcome compatibility difficulties by standardizing on machine tool controllers built by
Fanuc. Siemens was another market dominator in CNC controls, especially in Europe. In
the 2010s, controller differences and incompatibility are not as troublesome because
machining operations are usually developed with CAD/CAM applications that can output
the appropriate G-code for a specific machine through a software tool called a post-
processor (sometimes shortened to just a "post").
Some CNC machines use "conversational" programming, which is a wizard-like
programming mode that either hides G-code or completely bypasses the use of G-code.
Some popular examples are Okuma's Advanced One Touch (AOT), Southwestern
Industries' ProtoTRAK, Mazak's Mazatrol, Hurco's Ultimax and Winmax, Haas' Intuitive
Programming System (IPS), and Mori Seiki's CAPS conversational software.
Specific Codes
G-codes, also called preparatory codes, are any word in a CNC program that
begins with the letter G. Generally it is a code telling the machine tool what type of action
to perform, such as:
It has been pointed out over the years that the term "G-code" is imprecise because
"G" is only one of many letter addresses in the complete language. It comes from the
literal sense of the term, referring to one letter address and to the specific codes that can
be formed with it (for example, G00, G01, G28), but every letter of the English alphabet
is used somewhere in the language. Nevertheless, "G-code" is metonymically established
as the common name of the language.
List of Commonly Used G Codes
G00 Rapid Transverse Motion M00 Program stop - Tells the CNC machine to
G01 Motion by a feed rate stop in the middle of a program.
G02 Motion in an arc clockwise M01 Optional Program Stop - Tells the CNC
G03 Motion in an arc counter clockwise machine to stop ONLY if the optional stop switch
G04 Dwell is active
G17 XY Plane selection M02 Program end
G18 XZ Plane selection M03 Turns the Spindle on in a Clockwise
G19 YZ Plane selection direction
G28 Return to Machine zero for axis selected M04 Turns the Spindle on in a Counter-
G40 Cutter compensation Cancel Clockwise direction
G41 2D Cutter compensation Left M05 Turns the Spindle off
G42 2D Cutter compensation Right M06 Tool change
G43 Tool length compensation + (add to tool M07 Optional coolant is not available on all
length offset) machine configurations
G44 Tool length compensation – (subtract tool M08 Turns flood coolant on
length offset) M09 Turns flood coolant off
G49 Cancels G43 G44 M10 Normally used to turn 4th Axis brake on
G50 Sets a speed limit for Constant surface (mill)
speed (lathe) M11 Normally used to turn 4th Axis brake off
G52 Set Work Coordinate system (mill)
G54 Work coordinate system #1 M19 Spindle Orientation
G55 Work coordinate system #2 M30 Program end and reset
G56 Work coordinate system #3 M31 Chip conveyor on (forward)
G57 Work coordinate system #4 M33 Chip conveyor off
G58 Work coordinate system #5 M88 Turns through the spindle coolant on
G59 Work coordinate system #6 M89 Turns through the spindle coolant off
G65 Macro Subroutine call M97 Calls up sub program for local program
G70 Bolt Hole Circle M98 Sub Program Call
G71 Holt Hole Arc M99 Loop or return to rerun a sub
G72 Bolt holes along an Angle program
G73 High Speed Peck Drilling
G74 Reverse Tapping
G80 Turns off all canned cycles
G81 Drilling
G82 Spot Drilling
G83 Peck drilling
G84 Tapping cycle
G90 Calls up an absolute Co-ordinate grid
system Positioning
G91 Calls up an incremental Co-ordinate grid
system Positioning
G92 Set Work Coordinate system shift value -
(grid shift)
G94 Feed per minute mode
G95 Feed per spindle revolution mode
G96 turns on Constant Surface Speed (lathe)
G97 Turns off Constant Surface Speed (lathe)
G98 Canned cycle initial point return
G99 Canned cycle R Plande return