G-code reference
G66 G-Code: Modal Macro Call
Modal Macro Call — Calls a macro after every following positioning move until G67 cancels it. This is useful for custom drilling or engraving at many points.
| Property | Value |
|---|---|
| Code | G66 |
| Function | Modal Macro Call |
| Modal group | 12 |
| Type | Modal — stays active until replaced by another code of the same group |
| Used on | Mills and lathes |
| Syntax | G66 P_ args |
What does G66 do?
Calls a macro after every following positioning move until G67 cancels it. This is useful for custom drilling or engraving at many points.
G66 is modal: once programmed it remains in effect for the following blocks until another code from modal group 12 replaces it or the control is reset.
Syntax and parameters
G66 P_ args| Address | Meaning |
|---|---|
P | Macro number |
G66 example program
G66 P9100 Z-5.0 R2.0
X10.0 Y10.0
X20.0
G67▶ Open this example in the G-code viewer
Tips and common mistakes
- Every move triggers the macro — keep only position moves inside the G66 block.
Controller compatibility
G66 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.