CNCCookbook  Software and Information for Machinists

GW Editor User Guide

GWE Home

Getting Started

Setup

Commands

Keyboard

Revisions

CNC Simulator

Wizards

Tool Data

 

Mill G-Codes

Lathe G-Codes

 

Sample G-Code Files

 

GWE Tips

 

GWE Change Log

GWE Install

 

Troubleshooting

 

User's Club

Bookmark and Share

G-Code and M-Code Reference for Turning

These are the common g-codes for turning that G-Wizard Editor supports for Lathes. Code categories are the groupings for the g-code Wizard (type Ctrl+G for the Wizard). Function tells what the g-code does, Notes gives a little more information such as the parameters, and GWE Tutorial is a link (if any) to a tutorial that uses G-Wizard Editor to teach how to program the g-code.

 
Code
Category
Function

Notes

Tutorials
 
  G00
Motion
Move in a straight line at rapids speed. XYZ of endpoint

G00 and MDI.

Linear Motion: G00 and G01

 
  G01
Motion
Move in a straight line at last speed commanded by a (F)eedrate XYZ of endpoint

G01 and MDI.

Linear Motion: G00 and G01

 
  G02
Motion
Clockwise circular arc at (F)eedrate

XYZ of endpoint

IJK relative to center

R for radius

   
  G03
Motion
Counter-clockwise circular arc at (F)eedrate

XYZ of endpoint

IJK relative to center

R for radius

   
  G04
Motion
Dwell: Stop for a specified time.

P for milliseconds

X for seconds

   
  G09
Motion
Exact stop check      
  G10
Compensation
Programmable parameter input      
  G17
Coordinate
Select X-Y plane      
  G18
Coordinate
Select X-Z plane      
  G19
Coordinate
Select Y-Z plane      
  G20
Coordinate
Program coordinates are inches      
  G21
Coordinate
Program coordinates are mm      
  G27
Motion
Reference point return check      
  G28
Motion
Return to home position      
  G29
Motion
Return from the reference position      
  G30
Motion
Return to the 2nd, 3rd, and 4th reference point      
  G32
Canned
Constant lead threading (like G01 synchronized with spindle)      
  G40
Compensation
Tool cutter compensation off (radius comp.)      
  G41
Compensation
Tool cutter compensation left (radius comp.)      
  G42
Compensation
Tool cutter compensation right (radius comp.)      
  G43
Compensation
Apply tool length compensation (plus)      
  G44
Compensation
Apply tool length compensation (minus)      
  G49
Compensation
Tool length compensation cancel      
  G50
Compensation
Reset all scale factors to 1.0      
  G51
Compensation
Turn on scale factors      
  G52
Coordinate
Local workshift for all coordinate systems: add XYZ offsets      
  G53
Coordinate
Machine coordinate system (cancel work offsets)      
  G54
Coordinate
Work coordinate system (1st Workpiece)      
  G55
Coordinate
Work coordinate system (2nd Workpiece)      
  G56
Coordinate
Work coordinate system (3rd Workpiece)      
  G57
Coordinate
Work coordinate system (4th Workpiece)      
  G58
Coordinate
Work coordinate system (5th Workpiece)      
  G59
Coordinate
Work coordinate system (6th Workpiece)      
  G61
Other
Exact stop check mode      
  G62
Other
Automatic corner override      
  G63
Other
Tapping mode      
  G64
Other
Best speed path      
  G65
Other
Custom macro simple call   Subprograms and Macros  
  G70
Canned
Finish Turning Cycle      
  G71
Canned
Rough Turning Cycle  

G71: Rough Turning Cycle

G71 Type II: Rough Turning With "Pockets"

 
  G72
Canned
Rough Facing Cycle      
  G73
Canned
Pattern Repeating Cycle      
  G74
Canned
Peck Drilling Cycle      
  G75
Canned
Grooving Cycle      
  G76
Canned
Threading Cycle      
  G80
Canned
Cancel canned cycle      
  G83
Canned
Face drilling cycle      
  G84
Canned
Face Tapping cycle      
  G86
Canned
Boring canned cycle, spindle stop, rapid out      
  G87
Canned
Side Drilling Cycle      
  G88
Canned
Side Tapping Cycle      
  G89
Canned
Side Boring Cycle      
  G90
Coordinate
Absolute programming of XYZ (type B and C systems)      
  G90.1
Coordinate
Absolute programming IJK (type B and C systems)      
  G91
Coordinate
Incremental programming of XYZ (type B and C systems)      
  G91.1
Coordinate
Incremental programming IJK (type B and C systems)      
  G92
Coordinate
Thread Cutting Cycle      
  G92 (alternate)
Motion
Clamp of maximum spindle speed S    
  G94
Motion
Endface Turning Cycle      
             
  G96
Motion
Constant Surface Speed ON   G96: Constant Surface Speed  
  G97
Motion
Constant Surface Speed Cancel   G96: Constant Surface Speed  
 

G98

Motion
Linear Feedrate per Time      
  G99
Motion
Feedrate per Revolution      
             
             
             
             
   
       
 
M-Codes
 
Code
Category
Function

Notes

Tutorials
 
  M00
M-Code
Program Stop (non-optional)      
  M01
M-Code
Optional Stop: Operator Selected to Enable      
  M02
M-Code
End of Program      
  M03
M-Code
Spindle ON (CW Rotation)   M03 and MDI.  
  M04
M-Code
Spindle ON (CCW Rotation)      
  M05
M-Code
Spindle Stop   M05 and MDI.  
  M06
M-Code
Tool Change      
  M07
M-Code
Mist Coolant ON   M07 and MDI.  
  M08
M-Code
Flood Coolant ON   M08 and MDI.  
  M09
M-Code
Coolant OFF   M09 and MDI.  
             
  M13
M-Code
Spindle ON (CW Rotation) + Coolant ON   M13 and MDI.  
  M14
M-Code
Spindle ON (CCW Rotation) + Coolant ON   M14 and MDI.  
             
   
       
  M30
M-Code
End of Program, Rewind and Reset Modes      
   
       
  M97
M-Code
Haas-Style Subprogram Call   Subprograms and Macros  
  M98
M-Code
Subprogram Call   Subprograms and Macros  
  M99
M-Code
Return from Subprogram   Subprograms and Macros  

 

Home

 

Blog

     Cool

     Projects

     Software

     Techniques

     Business

     Products

Software

     G-Wizard Calculator

          User Guide

          Tips

          Change Log

     G-Wizard Editor

          User Guide

          Change Log

     Gearotic Gear Designer

     Troubleshooting

     User's Club

Cookbooks

     Feeds and Speeds

     G-Code Tutorial

     Beginners: Soon!

     Software

          G-Code: Soon!

          CAD/CAM: Soon!          

          Other Software: Soon!

     Machining: Soon!

     CNC Tech: Soon!

     Idea Notebooks: Soon!

 

Projects

     Completed

     Simple Wish List

     Model Wish List

     Rash Ideas

Machines

     Lathe: Soon!

     Mill: Soon!

     Router: Soon!

     Plasma Table

     3D Printer: Soon!

     Welding

     Other Machines

Resources

     Machinist's Search

     Videos

     Online Groups

     Individuals

     Reference Data

     Books

     CNC Dictionary

     Suppliers

     Tool Brands

Workshop

     Hall of Fame

     Organization: Soon!

 

About

     Customers

     Partners

     Our History

     Privacy Policy

 
All material © 2010-2012, CNCCookbook, Inc.