G65 Macro call / Custom macro call
Fanuc G-code · Mill, Lathe
On mills: Macro call
Calls a macro program once and passes values to it through letter addresses. The letters become local variables such as A to #1 and B to #2.
Format
G65 P [L] [A B C ...]
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
L | Number of repeats, 1 if left out |
A to Z | Arguments passed as local variables |
How it works
One shot, group 00.
Example program
G90 G54 G00 X0. Y0. (CIRCLE CENTER)
G43 H01 Z1. (LENGTH COMP)
G65 P9010 R1.5 Z-.5 H6. (BOLT CIRCLE MACRO, 6 HOLES)
G00 Z1. (CLEAR)
G43 H01 Z1. (LENGTH COMP)
G65 P9010 R1.5 Z-.5 H6. (BOLT CIRCLE MACRO, 6 HOLES)
G00 Z1. (CLEAR)
Example is in inch. Check offsets and clearances first.
Watch out for
- G, L, N, O and P cannot be used as arguments.
- Arguments with a decimal point are passed as written. Without one, the value may be read in least input units.
- Probe cycles from builders are usually G65 calls. Check the arguments in their manual.
On lathes: Custom macro call
Calls a macro program once and passes values through letter arguments, which arrive as local variables such as A in #1 and B in #2.
Format
G65 P [L] arguments
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro |
L | Number of times to repeat, 1 if left out |
A B C and others | Arguments passed to local variables |
How it works
Non-modal. G66 is the modal version.
Example program
G00 X2.1 Z-.5 (POSITION)
G65 P9010 A1.5 B.25 (CALL GROOVE MACRO, DIA 1.5, WIDTH .25)
G00 X3. (CLEAR)
G65 P9010 A1.5 B.25 (CALL GROOVE MACRO, DIA 1.5, WIDTH .25)
G00 X3. (CLEAR)
Example is in inch. Check offsets and clearances first.
Watch out for
- Use decimal points in arguments. A1 can be read as A.0001 in inch.
- Letters G, L, N, O and P cannot be used as arguments.
Related codes
G65 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| 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 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 G65 in the app All Fanuc G-codes