Home › G-codes › Siemens 808D ISO › G65
G65 Macro call, single
Siemens 808D ISO G-code · Mill, Lathe
On mills: Macro call, single
Calls macro program P and runs it L times, passing the other addresses in the block as arguments. Non-modal: it runs once at this block.
Format
Addresses
| Address | What it does |
|---|---|
P | Macro program number |
L | Number of runs |
A to Z | Arguments passed to the macro |
How it works
Non-modal, group 18. Optional function.
Example program
S1000 M03 (SPINDLE CW)
G65 P10 F55. X150. Y100. S2000 (CALL 0010 WITH ARGUMENTS)
X50. (NORMAL MOVE AFTER THE MACRO)
…
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, single
Calls a macro program once (or L times) and passes the other addresses in the block as arguments. The arguments land in system variables $C_A to $C_Z.
Format
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
L | Number of runs |
A to Z | Arguments, stored in $C_A to $C_Z. I J K up to 10 times as $C_I[n] |
How it works
Non-modal, G group 18.
Example program
G65 P0010 X30.0 Z-20.0 F0.2 (CALL MACRO 0010 WITH 3 ARGUMENTS)
G00 X150.0 Z100.0 (RETRACT)
Example is in inch. Check offsets and clearances first.
Watch out for
- Arguments can be read only in Siemens mode. Start the macro with PROC and its name, or switch with G290 before reading $C_X and back with G291.
- The program number is padded to 4 digits with zeros. For up to 8 digits set MD20734 bit 6.
- End an ISO mode macro with M99, a Siemens mode macro with M17.
Related codes
G65 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Macro call |
| Haas NGC | Macro subprogram call |
| Mazak (EIA) | Macro call, single |
| Okuma OSP | Droop control on |
| Mitsubishi M70 M80 | Macro call |
| Brother Speedio | Macro call |
| Mach3 Mach4 | Macro call, Mach4 |
| Centroid CNC12 Acorn | Macro call with arguments |
| Hurco WinMax (NC) | Macro call with arguments |
| Swiss (Citizen Star) | Macro 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 G65 in the app All Siemens 808D ISO G-codes