spinner
{{ menu }}

System variables list

FANUC Macro B system variables provide access to internal CNC control data including machine coordinates, offsets, modal states, timers and so on. This makes them essential for advanced CNC automation.
Common use cases include probing and automatic offset adjustment, adaptive machining programs, tool life tracking, and custom macro cycles. By using system variables, manufacturers can improve machining accuracy, reduce setup time, and automate complex CNC processes.

Common system variables {{ fanucA }}{{ fanucB }}{{ fanucC }}{{ haas }}

Variable Meaning
#3000 Custom alarm message
#3006 Operator message
#3001 This variable acts as a timer that counts continuously at 1 millisecond intervals. Upon reaching 2,147,483,648 milliseconds, the timer returns to 0.
#3011 This variable contains the current date (year / month / day). for example, February 01, 2020 is stored as 20200201.
#3012 This variable contains the current time (hours / minutes / seconds) . for example, February 01, 2020 is stored as 20200201. For example, 15 minutes and 10 seconds after 4 p.m. is stored as 161410.
{{ back-2-manual }}

Tool data (mill) {{ fanucA }}{{ fanucB }}{{ fanucC }}

Variable (200 tools max) or (up to 400) Meaning
#2201 - #2400 or #11001 - #11400 Tool length
#2001 - #2200 or #10001 - #10400 Tool length wear
#2401 - #2600 or #13001 - #13400 Tool radius
#2601 - #2800 or #12001 - #12400 Tool radius wear
{{ back-2-manual }}

Tool data (lathe) {{ fanucA }}{{ fanucB }}{{ fanucC }}

Variable (64 tools max) or (up to 160) Meaning
#2701 - #2764 or #10001 - #10160 X-axis offset
#2001 - #2064 or #15001 - #15160 X-axis offset wear
#2801 - #2864 or #11001 - #11160 Z-axis offset
#2101 - #2164 or #16001 - #16160 Z-axis offset wear
#2901 - #2964 or #12001 - #12160 Nose radius
#2201 - #2264 or #17001 - #17160 Nose radius wear
#2300 - #2364 or #13001 - #13160 Tool-tip direction
{{ back-2-manual }}

Work offset variables {{ fanucA }}{{ fanucB }}

Variable Meaning
#2500 - #2800 G53
#2501 - #2801 G54
#2502 - #2802 G55
#2503 - #2803 G56
#2504 - #2804 G57
#2505 - #2805 G58
#2506 - #2806 G59
{{ back-2-manual }}

Work offset variables {{ fanucC }}

Variable Meaning
#5201 - #5205 G53
#5221 - #5225 G54
#5241 - #5245 G55
#5261 - #5265 G56
#5281 - #5285 G57
#5301 - #5305 G58
#5321 - #5325 G59
{{ back-2-manual }}

System variables {{ fanucA }}{{ fanucB }}

Variable G-code Group number
#4001 G00 G01 G02 G03 G33 1
#4002 G17 G18 G19 2
#4003 G90 G91 3
#4004 G22 G23 4
#4005 G93 G94 G95 5
#4006 G20 G21 6
#4007 G40 G41 G42 7
#4008 G43 G44 G45 8
#4009 G73 G74 G76 G80 G81 G82 G83 G84 G85 G86 G87 G88 G89 9
#4010 G98 G99 10
#4011 G50 G51 11
#4012 G65 G66 G67 12
#4013 G96 G97 13
#4014 G54 G55 G56 G57 G58 G59 14
#4015 G61 G62 G63 G64 15
#4016 G68 G69 16
#4017 G15 G16 17
#4019 G40.1 G41.1 G42.1 19
#4022 G50.1 G51.1 22
{{ back-2-manual }}

System variables {{ fanucC }}

Variable - previous line Variable - current line G-code Group number
#4001 #4201 G00 G01 G02 G03 G33 1
#4002 #4202 G17 G18 G19 2
#4003 #4203 G90 G91 3
#4004 #4204 G22 G23 4
#4005 #4205 G93 G94 G95 5
#4006 #4206 G20 G21 6
#4007 #4207 G40 G41 G42 7
#4008 #4208 G43 G44 G45 8
#4009 #4209 G73 G74 G76 G80 G81 G82 G83 G84 G85 G86 G87 G88 G89 9
#4010 #4210 G98 G99 10
#4011 #4211 G50 G51 11
#4012 #4212 G65 G66 G67 12
#4013 #4213 G96 G97 13
#4014 #4214 G54 G55 G56 G57 G58 G59 14
#4015 #4215 G61 G62 G63 G64 15
#4016 #4216 G68 G69 16
#4017 #4217 G15 G16 17
#4018 #4218 G50.1 G51.1 18
#4019 #4219 G40.1 G41.1 G42.1 19
{{ back-2-manual }}

Other modal {{ fanucA }}{{ fanucB }}

Variable Adress
#4102 "B" - axis position
#4107 "D" - cutter radius
#4108 "E" - feed rate (optional)
#4109 "F" - feed rate
#4111 "H" - tool length
#4113 "M" - miscellaneous
#4115 "O" - program number
#4119 "S" - speed rate
#4120 "T" - tool number
{{ back-2-manual }}

Other modal {{ fanucC }}

Variable - previous line Variable - current line Adress
#4102 #4302 "B" - axis position
#4107 #4307 "D" - cutter radius
#4108 #4308 "E" - feed rate (optional)
#4109 #4309 "F" - feed rate
#4111 #4311 "H" - tool length
#4113 #4313 "M" - miscellaneous
#4115 #4315 "O" - program number
#4119 #4319 "S" - speed rate
#4120 #4320 "T" - tool number
{{ back-2-manual }}

Motion system variables

Variable Meaning
#5001 Previous line (X)
#5002 Previous line (Y)
#5003 Previous line (Z)
#5041 Current line (X)
#5042 Current line (Y)
#5043 Current line (Z)
{{ back-2-manual }}