Home › G-codes › Mach3 Mach4 › G66
G66 Modal macro call, Mach4
Mach3 Mach4 G-code · Mill
Mach4. Like G65, but the macro runs again on each following block with new values until G67.
Format
G66 P [A] [B] [C] ...
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
A B C X Y Z | Arguments passed as local variables |
How it works
Modal. Cancel with G67.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
G43 H1 Z1.0 (LENGTH OFFSET)
G66 P9100 Z-0.25 R0.5 (MODAL MACRO)
…
T1 M6 (TOOL CHANGE)
G43 H1 Z1.0 (LENGTH OFFSET)
G66 P9100 Z-0.25 R0.5 (MODAL MACRO)
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Always cancel with G67. Every later block with axis words runs the macro again.
Related codes
G66 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Modal macro call |
| Mazak (EIA) | Macro modal call |
| Mitsubishi M70 M80 | Modal macro call A |
| Brother Speedio | Modal macro call |
| Fagor 8055 8065 | Irregular pocket canned cycle |
| Hurco WinMax (NC) | Modal macro call |
| Fadal | Modal subroutine call |
Every G-code for Mach3 Mach4 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 Mach3 Mach4 G-codes