G65: Macro call
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.
| Type | G-code |
|---|---|
| Machine | Mill and lathe |
| Group | Non-modal |
| Modal | No: acts only on its own line |
G65 example
G65 P9010 A10. B5. Run macro O9010 with A=10 and B=5.
| Word | What it means here |
|---|---|
G65 | Macro call |
P9010 | a 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
| Code | What 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.
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
-
What does
G65do? (Mill and lathe) -
Which code: Calls a macro program and passes it arguments.(Mill and lathe)
-
What does
M98do? (Mill and lathe)
Show the answers
- Calls a macro program and passes it arguments.
- G65
- Calls another program as a subprogram.
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.