G-code reference

G65: Macro call

G65 is macro call. Calls a macro program and passes it arguments. It is non-modal, so it acts only on the line it is written on.

What G65 does

G65 calls a custom macro program with P and passes values as letter arguments (A, B, C and so on), which the macro reads as variables. Unlike M98, it can pass data. It needs the macro option on the control.

TypeG-code
MachineMill and lathe
GroupNon-modal
ModalNo: acts only on its own line

G65 example

G65 P9010 A10. B5.

Run macro O9010 with A=10 and B=5.

WordWhat it means here
G65Macro call
P9010a parameter: dwell time, program number, sequence number or cycle setting, depending on the code
A10.an argument passed to a macro, or the A rotary axis
B5.an argument passed to a macro, or the B rotary axis

Codes people confuse with G65

CodeWhat it does instead
M98 Subprogram call. Calls another program as a subprogram.

Other codes in the non-modal group

These also act only on their own line.

  • G04 Dwell
  • G09 Exact stop (one block)
  • G10 Programmable data input
  • G28 Return to reference position
  • G30 Return to second reference position
  • G50 Maximum spindle speed (lathe)
  • G52 Local coordinate system
  • G53 Machine coordinate move
  • G92 Set coordinate system (shift)

Meanings follow the common Fanuc-style standard that Haas, Okuma (EIA mode), Mitsubishi, LinuxCNC and most other controls share for this code. Options and parameters change details from machine to machine, so check the manual for your control.

Quick check: G65

  1. What does G65 do? (Mill and lathe)

  2. Which code: Calls a macro program and passes it arguments.(Mill and lathe)

  3. What does M98 do? (Mill and lathe)

Show the answers
  1. Calls a macro program and passes it arguments.
  2. G65
  3. Calls another program as a subprogram.

Drill this code with the rest of the core set

More practice hubs

Frequently asked questions

What does G65 mean in CNC programming?
Macro call. Calls a macro program and passes it arguments.
Is G65 modal?
No. G65 acts only on the line where it is written; the next line goes back to whatever modal codes were already active.
What is the difference between G65 and M98?
G65 (macro call): calls a macro program and passes it arguments. M98 (subprogram call): calls another program as a subprogram.

G-Code Sprint is an educational practice tool only. It is not a CNC simulator, machine controller, safety manual, or replacement for instruction. Always follow your instructor, employer, machine manual, and shop procedures.

Free preview · no card Try G-Code Sprint