G-Code Commands for CNC Turning and Milling Operations | ||
Code | Turning | Milling |
G00 | Fast move | Fast move |
G01 | Linear interpolation | Linear interpolation |
G02 | Circular Interpolation CW | Circular Interpolation CW |
G03 | Circular interpolation CCW | Circular interpolation CCW |
G04 | Dwell | Dwell |
G09 | Exact stop check | Exact stop check |
G10 | Data setting | Data setting |
G11 | Data setting cancel | Data setting cancel |
G15 | — | Polar coordinates |
G16 | — | Polar coordinates cancel |
G17 | — | XY plane designate |
G18 | — | ZX plane designate |
G19 | — | YZ plane designate |
G20 | Set English units | Set English units |
G21 | Set metric units | Set metric units |
G22 | Stored stroke check on | Stored stroke check on |
G23 | Stored stroke check off | Stored stroke check off |
G25 | Spindle speed fluctuation detect on | Spindle speed fluctuation detect on |
G26 | Spindle speed fluctuation detect off | Spindle speed fluctuation detect off |
G27 | Machine zero position check | Machine zero position check |
G28 | Machine zero return (point 1) | Machine zero return (point 1) |
G29 | Return from machine zero | Return from machine zero |
G30 | Machine zero return (point 2) | Machine zero return (point 2) |
G31 | Skip function | Skip function |
G32 | Threading constant lead | — |
G35 | Circular threading CW | — |
G36 | Circular threading CCW | — |
G40 | Tool nose radius offset cancel | Cutter radius offset cancel |
G41 | Tool nose radius offset left | Cutter radius offset left |
G42 | Tool nose radius offset right | Cutter radius offset right |
G43 | — | Tool length offset positive |
G44 | — | Tool length offset negative |
G49 | — | Tool length compensation cancel |
G50 | Maximum rpm preset | Scaling function cancel |
G51 | — | Scaling function |
G52 | Local coordinate system set | Local coordinate system set |
G53 | Machine coordinate system set | Machine coordinate system set |
G54 | Work coordinate 1 | Work coordinate 1 |
G55 | Work coordinate 2 | Work coordinate 2 |
G56 | Work coordinate 3 | Work coordinate 3 |
G57 | Work coordinate 4 | Work coordinate 4 |
G58 | Work coordinate 5 | Work coordinate 5 |
G59 | Work coordinate 6 | Work coordinate 6 |
G60 | — | Single direction positioning |
G61 | Exact stop mode | Exact stop mode |
G62 | Automatic corner override mode | Automatic corner override mode |
G63 | — | Tapping mode |
G64 | Cutting mode | Cutting mode |
G65 | Custom macro call | Custom macro call |
G66 | Custom modal macro call | Custom macro modal call |
G67 | Custom modal macro call cancel | Custom modal macro call cancel |
G68 | Mirror image for double turrets | Coordinate system rotation |
G69 | Mirror image for double turrets cancel | Coordinate system rotation cancel |
G70 | Profile finishing cycle | — |
G71 | Profile roughing cycle Z axis direction | — |
G72 | Profile roughing cycle X axis direction | — |
G73 | Pattern repetition cycle | High speed peck drilling cycle |
G74 | Drilling cycle | Left hand threading cycle |
G75 | Grooving cycle | — |
G76 | Threading cycle | Fine boring cycle |
G80 | — | Fixed cycle cancel |
G81 | — | Drilling cycle |
G82 | — | Spot drilling cycle |
G83 | — | Peck drilling cycle |
G84 | — | Right hand threading cycle |
G85 | — | Boring cycle |
G86 | — | Boring cycle |
G87 | — | Back boring cycle |
G88 | — | Boring cycle |
G89 | — | Boring cycle |
G90 | Cutting cycle AA /Absolute command | Absolute command |
G91 | Incremental command | Incremental command |
G92 | Tool position register | Tool position register |
G94 | Feed rate per minute | — |
G95 | Feed rate per revolution | — |
G96 | Constant surface speed | — |
G97 | Constant spindle speed | — |
G98 | Feed rate per minute | Return to initial level in a fixed cycle |
G99 | Feed rate per revolution | Return to R level in a fixed cycle |