G-code reference
G97 G-Code: Constant RPM (CSS Cancel)
Constant RPM (CSS Cancel) — S is spindle RPM. It is required for threading (G76/G92) and centre drilling.
| Property | Value |
|---|---|
| Code | G97 |
| Function | Constant RPM (CSS Cancel) |
| Modal group | 02 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Lathes |
| Syntax | G97 S_ |
What does G97 do?
S is spindle RPM. It is required for threading (G76/G92) and centre drilling.
G97 is modal: once programmed it remains in effect for the following blocks until another code from modal group 02 replaces it or the control is reset.
Syntax and parameters
G97 S_| Address | Meaning |
|---|---|
S | RPM |
G97 example program
G97 S800 M03 (threading speed)▶ Open this example in the G-code viewer
Tips and common mistakes
- Threading in G96 makes the lead slip — always use G97.
Controller compatibility
G97 follows the ISO/Fanuc dialect used by Fanuc, Haas, Brother, Doosan, Hurco (ISO mode), Mazak (EIA/ISO mode), Okuma (G-code mode) and Siemens in ISO dialect mode. Parameters, option packages and builder-specific behaviour can differ, so confirm the details in your machine's programming manual before running a new program.
Related codes
Frequently asked questions
Is G97 modal?
Yes. G97 belongs to modal group 02 and stays active until another code of that group is programmed.
What does G97 mean in CNC?
G97 means Constant RPM (CSS Cancel). S is spindle RPM. It is required for threading (G76/G92) and centre drilling.
What is the difference between G97 and G96?
G97 is Constant RPM (CSS Cancel), while G96 is Constant Surface Speed (CSS). See the G96 page for its syntax and examples.
Can I use G97 on a mill?
Usually not with the same meaning: G97 is documented here for lathes. Check your control manual for the equivalent.