CNC Machinist Calculator Ultra

Home › G-codes › Fanuc › G65

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

AddressWhat it does
PProgram number of the macro
LNumber of repeats, 1 if left out
A to ZArguments 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)

Example is in inch. Check offsets and clearances first.

Watch out for

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

AddressWhat it does
PProgram number of the macro
LNumber of times to repeat, 1 if left out
A B C and othersArguments 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)

Example is in inch. Check offsets and clearances first.

Watch out for

Related codes

G66 · G67 · G31

G65 on other controls

The same number can mean something different on another control.

ControlMeaning
Haas NGCMacro subprogram call
Mazak (EIA)Macro call, single
Okuma OSPDroop control on
Mitsubishi M70 M80Macro call
Brother SpeedioMacro call
Mach3 Mach4Macro call, Mach4
Centroid CNC12 AcornMacro 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

App Store Google Play