Home › G-codes › Siemens 808D ISO › G66
G66 Macro call, modal
Siemens 808D ISO G-code · Mill, Lathe
On mills: Macro call, modal
Calls macro program P with the arguments after every traversing move until G67 cancels it. Used to repeat an operation at many positions.
Format
Addresses
| Address | What it does |
|---|---|
P | Macro program number |
L | Number of runs per call |
A to Z | Arguments passed to the macro |
How it works
Modal, group 12. Cancel with G67. Optional function.
Example program
G66 P20 Z-10. R2. F150. (MODAL MACRO 0020 ON)
X20. Y20. (MOVE, THEN MACRO RUNS)
X40. (MOVE, THEN MACRO RUNS)
…
The full 5-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- Arguments do not go into Fanuc #1 to #26. They land in $C_A to $C_Z, with I J K up to 10 times in $C_I[0] and so on.
- Arguments can be read only in Siemens mode. Start the macro with PROC and its name, or switch to G290 inside it.
- P is padded to 4 digits, so P10 calls 0010. With MD20734 bit 6 set, P takes up to 8 digits with no padding.
On lathes: Macro call, modal
Switches on a modal macro call. The macro runs again after every move block until G67. Arguments are passed as with G65.
Format
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
L | Number of runs per call |
A to Z | Arguments, stored in $C_A to $C_Z |
How it works
Modal, G group 12. Cancel with G67.
Example program
G00 X40.0 (MACRO RUNS AT X40)
G00 X30.0 (MACRO RUNS AT X30)
G67 (MODAL MACRO OFF)
Example is in inch. Check offsets and clearances first.
Watch out for
- The macro is called after each traversing command, so every move block in between triggers it.
- Always cancel with G67 before moves that must not call the macro.
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 |
| Mach3 Mach4 | Modal macro call, Mach4 |
| Hurco WinMax (NC) | Modal macro call |
| Fadal | Modal subroutine call |
Every G-code for Siemens 808D ISO 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 Siemens 808D ISO G-codes