Fanuc Macro B reference

Fanuc Macro B quick reference: G65 argument letter to local variable map, common and system variable ranges including work and tool offset addresses, IF, WHILE, GOTO and DPRNT syntax, and a G and M code table across Fanuc, Haas, Mazak, Okuma, Siemens and Heidenhain.

Fanuc Macro B reference

The things you look up every time you write a macro: which #variable an argument lands in, where the offsets live, the control flow syntax, and what the same G or M code is called on the other controls.

X → #24G65 P9xxx Xvalue loads local variable #24. Inside the macro read it as #24. Compare with #0 to see if it was passed.
LetterVariableLetterVariable
A#1Q#17
B#2R#18
C#3S#19
D#7T#20
E#8U#21
F#9V#22
H#11W#23
I#4X#24
J#5Y#25
K#6Z#26
M#13
Not usable as arguments: G, L, N, O, P. Argument values need a decimal point: X1. not X1.
I/J/K setIJK
1#4#5#6
2#7#8#9
3#10#11#12
4#13#14#15
5#16#17#18
6#19#20#21
7#22#23#24
8#25#26#27
9#28#29#30
10#31#32#33

Variable addresses and code meanings are the published defaults. OEM parameter settings move some of them, so read one back with a known value on your machine before you write to it.