Home › G-codes › Mach3 Mach4 › G65
G65 Macro call, Mach4
Mach3 Mach4 G-code · Mill
Mach4. Calls a macro program once and passes the letters as local variables, A to #1, B to #2 and so on, like Fanuc macro B.
Format
G65 P [A] [B] [C] [D] ...
Addresses
| Address | What it does |
|---|---|
P | Program number of the macro, O number |
A B C | Arguments, A to #1, B to #2, C to #3 |
X Y Z | Arguments, X to #24, Y to #25, Z to #26 |
How it works
Non modal. No repeat word.
Example program
G0 G20 G90 G54 G17 G40 G49 G80 (SAFE START, INCH)
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
T1 M6 (TOOL CHANGE)
S5000 M3 (SPINDLE ON)
G43 H1 Z1.0 (LENGTH OFFSET)
…
The full 7-line example is in the app. Example is in inch. Check offsets and clearances first.
Watch out for
- This is G code macro, not an M code Lua macro. Mach3 has no G65.
- The macro is found in the file or the Subroutines folder by O number, like M98.
Related codes
G65 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Fanuc | Macro call |
| Haas NGC | Macro subprogram call |
| Mazak (EIA) | Macro call, single |
| Okuma OSP | Droop control on |
| Mitsubishi M70 M80 | Macro call |
| Brother Speedio | Macro call |
| Centroid CNC12 Acorn | Macro call with arguments |
| Hurco WinMax (NC) | Macro call with arguments |
| Swiss (Citizen Star) | Macro call |
Every G-code for Mach3 Mach4 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 Mach3 Mach4 G-codes