Home › G-codes › Haas NGC › G65
G65 Macro subprogram call
Haas NGC G-code · Mill, Lathe
On mills: Macro subprogram call
Calls a macro subprogram and passes letter arguments into local variables. Needs the macro option.
Format
G65 P [L] [A B C ...]
Addresses
| Address | What it does |
|---|---|
P | Program number to call |
L | Number of times to repeat |
A to Z | Arguments passed to local variables 1 to 26 |
How it works
Non-modal, group 00.
Example program
G90 G54 G00 X1. Y1. (POSITION)
G65 P9010 A.5 B.25 (CALL MACRO 9010 WITH A AND B VALUES)
G00 Z1. (RETRACT)
G65 P9010 A.5 B.25 (CALL MACRO 9010 WITH A AND B VALUES)
G00 Z1. (RETRACT)
Example is in inch. Check offsets and clearances first.
Watch out for
- Arguments are only passed with G65. M98 does not pass arguments.
- Local variables are cleared when the macro ends.
On lathes: Macro subprogram call
Calls a macro program and passes argument values to it. L repeats the call. Needs the macro option.
Format
G65 P [L] [arguments]
Addresses
| Address | What it does |
|---|---|
P | Program number to call |
L | Repeat count |
A to Z | Arguments passed to local variables |
How it works
Non-modal, group 00.
Example program
(CALL GROOVE MACRO O9010 WITH ARGUMENTS)
G65 P9010 X1.5 Z-.75 W.125 (X DIA, Z LOCATION, W WIDTH)
M30 (END PROGRAM)
G65 P9010 X1.5 Z-.75 W.125 (X DIA, Z LOCATION, W WIDTH)
M30 (END PROGRAM)
Example is in inch. Check offsets and clearances first.
Watch out for
- Put any M code after G65 on the same line, not before it, or alarm 339 occurs.
- G65 calls nest up to 9 deep.
- Argument letters map to local variables, for example A to 1 and B to 2.
G65 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Macro 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 Haas NGC 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 Haas NGC G-codes