Printed from Kezuriba (kezuriba.net/en/nc/g98/)
G98
Machining center, LatheModal, group 10Canned cycle: return to initial point
On machining centers
G98 G81 X_ Y_ Z_ R_ F_
- After drilling, returns to the height before entering the cycle (the initial point) before moving to the next hole. For clearing clamps or steps
- If the initial point is lower than the R point, it returns to the R point (NIST)
- The default on many machines (Siemens ISO M)
Diagram: Height to move to the next hole after drilling
Full guide with examples: Canned cycles: how each one moves, how to choose, G98 vs G99
Try it in the simulator (machining center)
G81 repeats rapid to R → feed to Z → retract for each hole. G99 returns to the R point, G98 to the initial level.
X—
Y—
Z—
T—
S0
F0
—0:00
Simulator with exercises: Machining center page
On lathes: Feed per minute (mm/min) (G-code system A)
The same number means something different on lathes (FANUC-type G-code system A). Group 05.
G98 G01 X_ F_ (F is in mm/min)
- On lathes, G98/G99 switch the feed unit (equivalent to G94/G95 on machining centers)
- On lathes in systems B/C, G98/G99 are the return points of canned cycles (Siemens ISO T, group 11)
Differences between controls and machines
The same code can be written or assigned differently depending on the CNC control and the machine builder. Always check your machine’s manual.
| Source | Machine | Item | Detail |
|---|---|---|---|
| Haas | Lathe | Group | 10 |
| Siemens (ISO dialect) | Lathe | Meaning | In system B: return to initial point in drilling cycles (group 11) |
Frequently asked questions about G98
- What is G98 (Canned cycle: return to initial point) used for and how is it formatted in a CNC program?
- G98 commands "Canned cycle: return to initial point" on Machining center, Lathe. The standard program format is "G98 G81 X_ Y_ Z_ R_ F_". After drilling, returns to the height before entering the cycle (the initial point) before moving to the next hole. For clearing clamps or steps
- Is G98 a modal code or a one-shot (non-modal) code?
- G98 is a modal code (Group 10). Once commanded, it remains active across subsequent blocks until another code from the same modal group overrides it or the control is reset. Always state or cancel modal states explicitly in your safety block and at the end of a tool operation so residual modes do not cause unexpected motion when restarting mid-program.
- Does G98 work differently on machining centers (mills) versus CNC lathes?
- Yes. On a machining center G98 means "Canned cycle: return to initial point", whereas on a CNC lathe (FANUC G-code System A) G98 means "Feed per minute (mm/min) (G-code system A)" (lathe format: "G98 G01 X_ F_ (F is in mm/min)"). Never copy G98 between mill and lathe programs without checking which G-code system (A, B, or C) your lathe uses.
- Are there differences in G98 across FANUC, Mitsubishi, Okuma, Haas, and Siemens controls?
- Yes. Control builders such as FANUC, Mitsubishi Electric (M80/M800), Okuma (OSP), Haas, Mazak, Siemens (SINUMERIK ISO dialect), and Heidenhain can differ in argument letters, decimal-point rules, and optional parameters for G98. Review the control comparison table above and verify the exact syntax in your machine’s programming manual before proving out the program.
- When should I use G98 (Initial Level Return) versus G99 (R-Point Return) in a canned cycle?
- On a machining center, G98 retracts the tool all the way to the initial Z plane after each hole, safely clearing clamps and bosses, whereas G99 retracts only to the R plane just above the part surface to save cycle time across a flat hole pattern. On FANUC System A lathes, G98 commands feed per minute (mm/min) and G99 commands feed per revolution (mm/rev).
Sources
The meaning of this code agrees in two or more sources from different publishers. Explanations are written in our own words.
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Milling, 04.2007 Edition (6FC5398-7BP10-0BA0) cache.industry.siemens.com
- Haas Automation, Inc. — G-code, M-code, and Setting (per-code explanation pages) haascnc.com
- Haas Automation, Inc. — Mill Operator's Manual – 17 Mill G-Codes (online version) haascnc.com
- National Institute of Standards and Technology (NIST), USA — The NIST RS274NGC Interpreter – Version 3 (NISTIR 6556, 2000) nvlpubs.nist.gov
- Mitsubishi Electric — The Basics of CNC Machining Programming (for Lathe) e-Learning material (PDF, BNP-C8027-688) mitsubishielectric.com
- Haas Automation, Inc. — Lathe Operator's Manual – 16 Lathe G-Codes (online version) haascnc.com
- Siemens AG — SINUMERIK 802D sl/840D/840D sl/840Di/840Di sl/810D Programming Manual ISO Turning, 04.2007 Edition cache.industry.siemens.com