G-code reference
G22 G-Code: Stored Stroke Check On
Stored Stroke Check On — Enables a programmable forbidden zone (stored stroke limit 2). If the tool tries to enter the area defined by the two corner points, the control stops with an…
| Property | Value |
|---|---|
| Code | G22 |
| Function | Stored Stroke Check On |
| Modal group | 04 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G22 X_ Y_ Z_ I_ J_ K_ |
What does G22 do?
Enables a programmable forbidden zone (stored stroke limit 2). If the tool tries to enter the area defined by the two corner points, the control stops with an alarm. It protects chucks, tailstocks and fixtures.
G22 is modal: once programmed it remains in effect for the following blocks until another code from modal group 04 replaces it or the control is reset.
Syntax and parameters
G22 X_ Y_ Z_ I_ J_ K_| Address | Meaning |
|---|---|
X Y Z | One corner of the zone (machine coordinates) |
I J K | Opposite corner |
G22 example program
G22 X-200.0 Z-150.0 I-100.0 K-50.0
(program)
G23▶ Open this example in the G-code viewer
Tips and common mistakes
- Whether the inside or outside of the zone is forbidden depends on a parameter.
Controller compatibility
G22 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.