G66 Modal macro call
Fanuc G-code · Mill and lathe
Sets a macro that is called automatically after every move block until G67. Used to run the same routine at a list of positions.
Format
G66 P [L] [arguments]
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
L | Number of repeats per call |
A to Z | Arguments passed as local variables |
How it works
Modal, group 12. Cancel with G67.
Example program
G66 P9020 Z-.25 R.1 F10. (MACRO AT EACH POSITION)
G00 X1. Y1. (CALL AT HOLE 1)
X2. (CALL AT HOLE 2)
G67 (CANCEL MODAL CALL)
G00 X1. Y1. (CALL AT HOLE 1)
X2. (CALL AT HOLE 2)
G67 (CANCEL MODAL CALL)
Example is in inch. Check offsets and clearances first.
Watch out for
- The macro is called after each block with axis motion, not on blocks without motion.
- Always cancel with G67 before moving on, or the macro runs at every later move.
Related codes
G66 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Mazak (EIA) | Macro modal call |
| Mitsubishi M70 M80 | Modal macro call A |
| Brother Speedio | Modal macro call |
| Fagor 8055 8065 | Irregular pocket canned cycle |
| Mach3 Mach4 | Modal macro call, Mach4 |
| Hurco WinMax (NC) | Modal macro call |
| Fadal | Modal subroutine call |
Every G-code for Fanuc in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open G66 in the app All Fanuc G-codes