Haas System Variables

Haas system variables are the #-numbers a macro uses to read and write the control’s state — tool offsets, work offsets, live positions, probe results, timers, pallet data, even settings and parameters. Haas follows the Fanuc Macro B model closely, then extends it: the Next Generation Control (NGC) adds five-digit variable ranges that mirror settings (#20000+), parameters (#30000+), and the full tool table (#50001+), making a Haas unusually transparent to a macro programmer.

NGC vs Legacy Numbering

The Classic Haas Control (CHC) used the traditional three-digit macro ranges (#100#999). The NGC moved general-purpose storage into five-digit ranges (#10000#10999) and kept the legacy numbers working as aliases into the same storage — #100 and #10100 are two addresses for the same variable on an NGC machine. Programs written for a classic control run unchanged; new programs get much more room (plus ranges that have no legacy equivalent at all). The table below shows both addresses side by side.

NGC VariableLegacy VariableUsageRead/Write
Macro Arguments / General Purpose
#1-#33#1-#33Macro call argumentsr/w
#10000-#10149#100-#149General-purpose variables saved on power offr/w
#10150-#10199#150-#199Probe values (if installed)r/w
#10200-#10399N/AGeneral-purpose variables saved on power offr/w
#10400-#10499N/AGeneral-purpose variables saved on power offr/w
#10500-#10549#500-#549General-purpose variables saved on power offr/w
#10550-#10599#550-#599Probe calibration data (if installed)r/w
#10600-#10699#600-#699General-purpose variables saved on power offr/w
#10700-#10799N/AGeneral-purpose variables saved on power offr/w
#700-#749#700-#749Hidden variables for internal use only
#709#709Used for the Fixture Clamp Input. Do not use for general purpose.r
#10800-#10999#800-#999General-purpose variables saved on power offr/w
#11000-#11063N/A64 discrete inputsr
#1064-#1068#1064-#1068Maximum axis loads for X, Y, Z, A, and B Axes, respectivelyr
#1080-#1087#1080-#1087Raw analog to digital inputsr
#1090-#1098#1090-#1098Filtered analog to digital inputsr
#1098#1098Spindle load with Haas vector driver
#1264-#1268#1264-#1268Maximum axis loads for C, U, V, W, and T-axes respectivelyr
Tool Offsets
#1601-#1800#1601-#1800Number of flutes on tools #1 through 200r/w
#1801-#2000#1801-#2000Maximum recorded vibrations of tools 1 through 200r
#2001-#2200#2001-#2200Tool length offsetsr/w
#2201-#2400#2201-#2400Tool length wearr/w
#2401-#2600#2401-#2600Tool diameter/radius offsetsr/w
#2601-#2800#2601-#2800Tool diameter/radius wearr/w
System & Control
#3000#3000Programmable alarm #3000=1 (ALARM)w
#3001#3001Millisecond timerr/w
#3002#3002Hour timerr/w
#3003#3003Single block suppressionr/w
#3004#3004Override [FEED HOLD] controlr/w
#3006#3006Programmable stop with message #3006=1 (STOP)w
#3011#3011Year, month, dayr
#3012#3012Hour, minute, secondr
#3020#3020Power on timerr
#3021#3021Cycle start timerr/w
#3022#3022Feed timerr/w
#3023#3023Present part timerr
#3024#3024Last complete part timerr
#3025#3025Previous part timerr
#3026#3026Tool in spindler
#3027#3027Spindle RPMr
#3028#3028Number of pallets loaded on receiverr
#3030#3030Single blockr
#3032#3032Block deleter
#3033#3033Opt stopr
#3034N/ASafe Runr
#3196#3196Cell safe timerr/w
#3201-#3400#3201-#3400Actual diameter for tools 1 through 200r/w
#3401-#3600#3401-#3600Programmable coolant positions for tools 1 through 200r/w
#3901#3901M30 count 1r/w
#3902#3902M30 count 2r/w
Modal Information
#4001-#4021#4001-#4021Previous block G-code group codesr
#4101-#4126#4101-#4126Previous block address codes. NOTE: Mapping of 4101 to 4126 is the same as the alphabetic addressing of Macro Arguments section; e.g., the statement X1.3 sets variable #4124 to 1.3.r
Position & Coordinate Data
#5001-#5006#5001-#5006Previous block end positionr
#5021-#5026#5021-#5026Present machine coordinate positionr
#5041-#5046#5041-#5046Present work coordinate positionr
#5061-#5069#5061-#5069Present skip signal position -X, Y, Z, A, B, C, U, V, Wr
#5081-#5086#5081-#5086Present tool offsetr
#5201-#5206#5201-#5206G52 work offsetsr/w
#5221-#5226#5221-#5226G54 work offsetsr/w
#5241-#5246#5241-#5246G55 work offsetsr/w
#5261-#5266#5261-#5266G56 work offsetsr/w
#5281-#5286#5281-#5286G57 work offsetsr/w
#5301-#5306#5301-#5306G58 work offsetsr/w
#5321-#5326#5321-#5326G59 work offsetsr/w
#5401-#5500#5401-#5500Tool feed timers (seconds)r/w
#5501-#5600#5501-#5600Total tool timers (seconds)r/w
#5601-#5699#5601-#5699Tool life monitor limitr/w
#5701-#5800#5701-#5800Tool life monitor counterr/w
#5801-#5900#5801-#5900Tool load monitor maximum load sensed so farr/w
#5901-#6000#5901-#6000Tool load monitor limitr/w
#6001-#6999#6001-#6999Reserved. Do not use.
#6198#6198NGC/CF flagr
Work Offsets / Additional Offsets
#7001-#7006#7001-#7006G110 (G154 P1) additional work offsetsr/w
#7021-#7026#7021-#7026G111 (G154 P2) additional work offsetsr/w
#7041-#7386#7041-#7386G112-G129 (G154 P3-P20) additional work offsetsr/w
#7501-#7506#7501-#7506Pallet priorityr/w
#7601-#7606#7601-#7606Pallet statusr
#7701-#7706#7701-#7706Part program numbers assigned to palletsr/w
#7801-#7806#7801-#7806Pallet usage countr/w
#8500#8500Advanced Tool Management (ATM) group ID — write the group to select it, then read #8501+r/w
#8501#8501ATM percent of available tool life of all tools in the groupr
#8502#8502ATM total available tool usage count in the groupr
#8503#8503ATM total available tool hole count in the groupr
#8504#8504ATM total available tool feed time (in seconds) in the groupr
#8505#8505ATM total available tool total time (in seconds) in the groupr
#8510#8510ATM next tool number to be usedr
#8511#8511ATM percent of available tool life of the next toolr
#8512#8512ATM available usage count of the next toolr
#8513#8513ATM available hole count of the next toolr
#8514#8514ATM available feed time of the next tool (in seconds)r
#8515#8515ATM available total time of the next tool (in seconds)r
#8550#8550Individual tool ID — write the tool/group ID to select it, then read #8551+r/w
#8551#8551Number of flutes of toolsr
#8552#8552Maximum recorded vibrationsr
#8553#8553Tool length offsetsr
#8554#8554Tool length wearr
#8555#8555Tool diameter offsetsr
#8556#8556Tool diameter wearr
#8557#8557Actual diameterr
#8558#8558Programmable coolant positionr
#8559#8559Tool feed timer (seconds)r
#8560#8560Total tool timers (seconds)r
#8561#8561Tool life monitor limitr
#8562#8562Tool life monitor counterr
#8563#8563Tool load monitor maximum load sensed so farr
#8564#8564Tool load monitor limitr
#9000#9000Thermal comp accumulatorr
#9000-#9015#9000-#9015Reserved (duplicate of axis thermal accumulator)
#9016#9016Thermal spindle comp accumulatorr
#9016-#9031#9016-#9031Reserved (duplicate of axis thermal accumulator from spindle)
#10000-#10999N/AGeneral purpose variablesr/w
#11000-#11255N/A256 discrete inputsr
#12000-#12255N/ADiscrete outputsr/w
#13000-#13063#1080-#1087 #1090-#1097Raw and filtered analog-to-digital inputsr
#13013N/ACoolant levelr
#14001-#14006N/AG110 (G154 P1) additional work offsetsr/w
#14021-#14026N/AG110 (G154 P2) additional work offsetsr/w
#14041-#14386N/AG110 (G154 P3-G154 P20) additional work offsetsr/w
#14401-#14406N/AG110 (G154 P21) additional work offsetsr/w
#14421-#15966N/AG110 (G154 P22-G154 P99) additional work offsetsr/w
#20000-#29999N/ASettings (mirror of the Settings page)r
#30000-#39999N/AParameters (mirror of the service-level parameter list)r
#32014N/AMachine Serial Numberr
#50001-#50200N/ATool Typer/w
#50201-#50400N/ATool materialr/w
#50401-#50600N/ATool Offset Pointr/w
#50601-#50800N/AEstimated RPMr/w
#50801-#51000N/AEstimated Feedrater/w
#51001-#51200N/AOffset Pitchr/w
#51201-#51400N/AActually VPS Estimated RPMr/w
#51401-#51600N/AWork Materialr/w
#51601-#51800N/AVPS Feedrater/w
#51801-#52000N/AApproximate lengthr/w
#52001-#52200N/AApproximate diameterr/w
#52201-#52400N/AEdge Measure heightr/w
#52401-#52600N/ATool Tolerancer/w
#52601-#52800N/AProbe Typer/w

Reading & Writing System Variables in a Macro

Probe a surface and write the result to a work offset. The core “touch off and set zero” chain on a Haas: feed with G31 until the probe trips, read the latched skip position, write it into the offset. On Haas the skip block is #5061–#5069 in axis order X, Y, Z, A, B, C, U, V, W — so Z is #5063:

(TOUCH TOP OF PART, SET IT AS G54 Z0)
G90 G31 Z-25. F50.        (feed down until the probe trips)
#5223 = #5223 + #5063     (shift G54 Z so the touched face = Z0)
G00 Z25.                  (retract)

Write an additional work offset (G154 P). The NGC exposes G154 P1–P99 at #14001+ (each P block is 20 apart); the legacy #7001+ block only reaches P20. Setting the G154 P5 X offset:

#101 = 5                       (which G154 P offset)
#[14001 + [[#101 - 1] * 20]] = #5061   (G154 P5 X = probed X position)

Track cycle counts across power-off. Haas retains the general-purpose ranges through power-off, so a retained variable makes a free parts/maintenance counter alongside the built-in #3901/#3902 M30 counters:

#10800 = #10800 + 1            (survives power-off)
IF [#10800 LT 500] GOTO 99
#3006 = 1 (500 PARTS - CHECK FIXTURE CLAMPS)
#10800 = 0
N99 M30

Read machine state for logging or adaptive decisions — the NGC exposes far more than Fanuc does by default:

#100 = #3026    (tool currently in the spindle)
#101 = #3027    (spindle RPM right now)
#102 = #1064    (max X-axis load seen)
#103 = #20009   (Setting 9: dimensioning - branch inch vs metric)

Gotchas Worth Knowing

  • Settings and parameters are read-only mirrors. #20000+ and #30000+ let a macro read any setting or parameter, but writes are rejected — change offsets through their own writable variables (or G10), and change settings on the Settings page.
  • Legacy and NGC numbers are the same storage. #500 and #10500 are one variable, not two. When porting a classic-control program, don’t “migrate” values between the two ranges — there is nothing to migrate.
  • Probe ranges are only meaningful with probing installed. #10150–#10199 (outputs) and #10550–#10599 (calibration) belong to the Renishaw/WIPS macros when the option is present; without it they are just more general-purpose storage.
  • #6001–#6999 is reserved. Classic Fanuc habits sometimes park data there; on a Haas, don’t.
  • Read positions with the axes stopped. As on Fanuc, #5021+/#5041+ are only trustworthy after motion completes — except the skip variables #5061+, which are latched at the instant the G31 input trips.

Try these in the Macro Playground — pick the Haas control, set the system-variable inputs (like #5063), and watch the values update live as the macro runs.

See also: Haas Programming & Macros for the language itself, Settings & Parameters for what #20000+ is mirroring, Renishaw Inspection Plus for the full probing system, and Reading & Writing System Variables for the same patterns on every control.

References

  • Haas, Operator’s Manual / NGC Programming Guide, Haas Automation, Inc.

Have a question or want to contribute?

Contact us with corrections, additions, or topics you'd like covered.

Get in Touch