Haas Macro and System Variables
Newer generations of Haas NGC software output macro variables directly through the MTConnect adapter as MacroRange arrays — no secondary Haas Serial adapter is needed. See Macro Variable Collection Methods by Control Generation below to determine which method applies to your machine.
The Haas Serial adapter + macros JSON configuration is required when:
- Your NGC control does not output MacroRange data via MTConnect (older NGC software generations)
- You need a specific system variable that is not included in the MacroRange blocks (e.g.
#3027spindle RPM,#3901M30 count)
If Setting 143 is not set to 4001, the Haas Serial adapter will not connect and macro variables will not be readable via that method.
Haas machines support reading macro and system variables via the Serial (DPRNT/MDC) connection. This is useful for accessing data not available via MTConnect, such as specific timers, counters, or custom machine settings.
Available Variable Types
Haas machines provide hundreds of macro and system variables. Below is a comprehensive reference of available system and macro variables that can be read from Haas NGC controllers.
Complete Haas System & Macro Variables Reference
| NGC Variable | Legacy Variable | Usage |
|---|---|---|
| #1-#33 | #1-#33 | Macro call arguments |
| #10000-#10149 | #100-#149 | General-purpose variables saved on power off |
| #10150-#10199 | #150-#199 | Probe values (if installed) |
| #10200-#10399 | N/A | General-purpose variables saved on power off |
| #10400-#10499 | N/A | General-purpose variables saved on power off |
| #10500-#10549 | #500-#549 | General-purpose variables saved on power off |
| #10550-#10599 | #550-#599 | Probe calibration data (if installed) |
| #10600-#10699 | #600-#699 | General-purpose variables saved on power off |
| #10700-#10799 | N/A | General-purpose variables saved on power off |
| #700-#749 | #700-#749 | Hidden variables for internal use only |
| #709 | #709 | Used for Fixture Clamp Input. Do not use for general purpose. |
| #10800-#10999 | #800-#999 | General-purpose variables saved on power off |
| #11000-#11063 | N/A | 64 discrete inputs (read only) |
| #1064-#1068 | #1064-#1068 | Maximum axis loads for X, Y, Z, A, and B axes |
| #1080-#1087 | #1080-#1087 | Raw analog to digital inputs (read only) |
| #1090-#1098 | #1090-#1098 | Filtered analog to digital inputs (read only) |
| #1098 | #1098 | Spindle load with Haas vector drive (read only) |
| #1264-#1268 | #1264-#1268 | Maximum axis loads for C, U, V, W, and T-axes |
| #1601-#1800 | #1601-#1800 | Number of flutes on tools #1 through 200 |
| #1801-#2000 | #1801-#2000 | Maximum recorded vibrations of tools 1 through 200 |
| #2001-#2200 | #2001-#2200 | Tool length offsets |
| #2201-#2400 | #2201-#2400 | Tool length wear |
| #2401-#2600 | #2401-#2600 | Tool diameter/radius offsets |
| #2601-#2800 | #2601-#2800 | Tool diameter/radius wear |
| #3000 | #3000 | Programmable alarm |
| #3001 | #3001 | Millisecond timer |
| #3002 | #3002 | Hour timer |
| #3003 | #3003 | Single block suppression |
| #3004 | #3004 | Override [FEED HOLD] control |
| #3006 | #3006 | Programmable stop with message |
| #3011 | #3011 | Year, month, day |
| #3012 | #3012 | Hour, minute, second |
| #3020 | #3020 | Power on timer (read only) |
| #3021 | #3021 | Cycle start timer |
| #3022 | #3022 | Feed timer |
| #3023 | #3023 | Present part timer (read only) |
| #3024 | #3024 | Last complete part timer (read only) |
| #3025 | #3025 | Previous part timer (read only) |
| #3026 | #3026 | Tool in spindle (read only) |
| #3027 | #3027 | Spindle RPM (read only) |
| #3028 | #3028 | Number of pallets loaded on receiver |
| #3030 | #3030 | Single block |
| #3032 | #3032 | Block delete |
| #3033 | #3033 | Opt stop |
| #3034 | N/A | Safe Run (read only) |
| #3196 | #3196 | Cell safe timer |
| #3201-#3400 | #3201-#3400 | Actual diameter for tools 1 through 200 |
| #3401-#3600 | #3401-#3600 | Programmable coolant positions for tools 1 through 200 |
| #3901 | #3901 | M30 count 1 |
| #3902 | #3902 | M30 count 2 |
| #4001-#4021 | #4001-#4021 | Previous block G-code group codes |
| #4101-#4126 | #4101-#4126 | Previous block address codes |
| #5001-#5006 | #5001-#5006 | Previous block end position |
| #5021-#5026 | #5021-#5026 | Present machine coordinate position |
| #5041-#5046 | #5041-#5046 | Present work coordinate position |
| #5061-#5069 | #5061-#5069 | Present skip signal position -X, Y, Z, A, B, C, U, V, W |
| #5081-#5086 | #5081-#5086 | Present tool offset |
| #5201-#5206 | #5201-#5206 | G52 work offsets |
| #5221-#5226 | #5221-#5226 | G54 work offsets |
| #5241-#5246 | #5241-#5246 | G55 work offsets |
| #5261-#5266 | #5261-#5266 | G56 work offsets |
| #5281-#5286 | #5281-#5286 | G57 work offsets |
| #5301-#5306 | #5301-#5306 | G58 work offsets |
| #5321-#5326 | #5321-#5326 | G59 work offsets |
| #5401-#5500 | #5401-#5500 | Tool feed timers (seconds) |
| #5501-#5600 | #5501-#5600 | Total tool timers (seconds) |
| #5601-#5699 | #5601-#5699 | Tool life monitor limit |
| #5701-#5800 | #5701-#5800 | Tool life monitor counter |
| #5801-#5900 | #5801-#5900 | Tool load monitor maximum load sensed so far |
| #5901-#6000 | #5901-#6000 | Tool load monitor limit |
| #6001-#6999 | #6001-#6999 | Reserved. Do not use. |
| #6198 | #6198 | NGC/CF flag |
| #7001-#7006 | #7001-#7006 | G110 (G154 P1) additional work offsets |
| #7021-#7026 | #7021-#7026 | G111 (G154 P2) additional work offsets |
| #7041-#7386 | #7041-#7386 | G112-G129 (G154 P3-P20) additional work offsets |
| #7501-#7506 | #7501-#7506 | Pallet priority |
| #7601-#7606 | #7601-#7606 | Pallet status |
| #7701-#7706 | #7701-#7706 | Part program numbers assigned to pallets |
| #7801-#7806 | #7801-#7806 | Pallet usage count |
| #8500 | #8500 | Advanced Tool Management (ATM) group ID |
| #8501 | #8501 | ATM percent of available tool life of all tools in the group |
| #8502 | #8502 | ATM total available tool usage count in the group |
| #8503 | #8503 | ATM total available tool hole count in the group |
| #8504 | #8504 | ATM total available tool feed time (in seconds) in the group |
| #8505 | #8505 | ATM total available tool total time (in seconds) in the group |
| #8510 | #8510 | ATM next tool number to be used |
| #8511 | #8511 | ATM percent of available tool life of the next tool |
| #8512 | #8512 | ATM available usage count of the next tool |
| #8513 | #8513 | ATM available hole count of the next tool |
| #8514 | #8514 | ATM available feed time of the next tool (in seconds) |
| #8515 | #8515 | ATM available total time of the next tool (in seconds) |
| #8550 | #8550 | Individual tool ID |
| #8551 | #8551 | Number of flutes of tools |
| #8552 | #8552 | Maximum recorded vibrations |
| #8553 | #8553 | Tool length offsets |
| #8554 | #8554 | Tool length wear |
| #8555 | #8555 | Tool diameter offsets |
| #8556 | #8556 | Tool diameter wear |
| #8557 | #8557 | Actual diameter |
| #8558 | #8558 | Programmable coolant position |
| #8559 | #8559 | Tool feed timer (seconds) |
| #8560 | #8560 | Total tool timers (seconds) |
| #8561 | #8561 | Tool life monitor limit |
| #8562 | #8562 | Tool life monitor counter |
| #8563 | #8563 | Tool load monitor maximum load sensed so far |
| #8564 | #8564 | Tool load monitor limit |
| #9000 | #9000 | Thermal comp accumulator |
| #9000-#9015 | #9000-#9015 | Reserved (duplicate of axis thermal accumulator) |
| #9016 | #9016 | Thermal spindle comp accumulator |
| #9016-#9031 | #9016-#9031 | Reserved (duplicate of axis thermal accumulator from spindle) |
| #10000-#10999 | N/A | General purpose variables |
| #11000-#11255 | N/A | 256 discrete inputs (read only) |
| #12000-#12255 | N/A | Discrete outputs |
| #13000-#13063 | N/A | Filtered analog to digital inputs (read only) |
| #13013 | N/A | Coolant level |
| #14001-#14006 | N/A | G110 (G154 P1) additional work offsets |
| #14021-#14026 | N/A | G110 (G154 P2) additional work offsets |
| #14041-#14386 | N/A | G110 (G154 P3-G154 P20) additional work offsets |
| #14401-#14406 | N/A | G110 (G154 P21) additional work offsets |
| #14421-#15966 | N/A | G110 (G154 P22-G154 P99) additional work offsets |
| #20000-#29999 | N/A | Settings |
| #30000-#39999 | N/A | Parameters |
| #32014 | N/A | Machine Serial Number |
| #50001-#50200 | N/A | Tool Type |
| #50201-#50400 | N/A | Tool material |
| #50401-#50600 | N/A | Tool Offset Point |
| #50601-#50800 | N/A | Estimated RPM |
| #50801-#51000 | N/A | Estimated Feedrate |
| #51001-#51200 | N/A | Offset Pitch |
| #51201-#51400 | N/A | Actually VPS Estimated RPM |
| #51401-#51600 | N/A | Work Material |
| #51601-#51800 | N/A | VPS Feedrate |
| #51801-#52000 | N/A | Approximate length |
| #52001-#52200 | N/A | Approximate diameter |
| #52201-#52400 | N/A | Edge Measure height |
| #52401-#52600 | N/A | Tool Tolerance |
| #52601-#52800 | N/A | Probe Type |
Bold entries indicate commonly used variables for production monitoring.
Note: Variable addresses for older Haas controllers can be found in the "Legacy Variable" column. NGC (Next Generation Control) variables are shown in the first column.
Configure Macro Variables in Adapter
To read macro variables, add a macros section to your Haas Serial adapter configuration. Do not add this to the MTConnect adapter — it will not work there.
{
"adapter": {
"mdcEnabled": 1
},
"macros": {
"opt-stop": 3033,
"last-m-code": 4113,
"part-timer": 3023,
"spindle-rpm": 3027,
"coolant-level": 13013,
"g54-x-offset": 5221,
"tool-1-life": 5701
}
}
How to Configure:
- On the Haas NGC control, verify Setting 143 is set to
4001- If it is not, set it now — without this, the Haas Serial adapter cannot connect
- In MachineMetrics, go to Assets → Machines
- Select your Haas machine
- If you have not already added a Haas Serial adapter, click Add Secondary Adapter and select Haas Serial with connection address
[MACHINE-IP]:4001 - Click on the Haas Serial adapter (not the MTConnect adapter)
- Add the JSON configuration above in the adapter settings JSON field
- Customize the macro names and variable numbers as needed
- Save changes
Macro Configuration Format:
- Key (left side): Data item name that will appear in MachineMetrics (use lowercase with hyphens)
- Value (right side): Haas macro variable number
Common Useful Variables:
{
"adapter": {
"mdcEnabled": 1
},
"macros": {
"opt-stop-enabled": 3033,
"block-delete-enabled": 3032,
"single-block-enabled": 3030,
"m30-count": 3901,
"part-timer-seconds": 3023,
"last-part-timer-seconds": 3024,
"current-tool": 3026,
"spindle-rpm-actual": 3027,
"power-on-hours": 3020,
"cycle-start-timer": 3021,
"feed-timer": 3022,
"coolant-level-percent": 13013
}
}
These macro variables will appear as data items in MachineMetrics alongside other machine data.
Tool Life Monitoring Example:
For tracking tool life counters and presets, use the tool life monitoring variables:
{
"adapter": {
"mdcEnabled": 1
},
"macros": {
"TLM_1_COUNT": 5701,
"TLM_1_PRESET": 5601,
"TLM_2_COUNT": 5702,
"TLM_2_PRESET": 5602,
"TLM_3_COUNT": 5703,
"TLM_3_PRESET": 5603,
"TLM_4_COUNT": 5704,
"TLM_4_PRESET": 5604,
"TLM_5_COUNT": 5705,
"TLM_5_PRESET": 5605
}
}
Variable Explanation:
- #5601-#5699: Tool life monitor limit (preset/maximum)
- #5701-#5800: Tool life monitor counter (current usage)
Example:
TLM_1_COUNT(Macro #5701) = Current count for Tool 1TLM_1_PRESET(Macro #5601) = Preset limit for Tool 1
If COUNT = 150 and PRESET = 500:
- Tool 1 is at 30% used (70% remaining)
Note: For detailed tool life monitoring setup and configuration, see the Tool Life Monitoring Guide.
Macro Variable Collection Methods by Control Generation
The method used to collect macro variables from a Haas NGC control depends on the vintage of the NGC machine's software. There are two approaches:
- Method 1 — Haas Serial Secondary Adapter (described above): Older NGC software versions expose macro variables individually via the Serial/MDC adapter. You request specific variables by number in the JSON configuration. This is the method described in the section above.
- Method 2 — MTConnect MacroRange Arrays (newer NGC software): Newer NGC software versions output macro variables in bulk directly through the MTConnect adapter, as large comma-separated arrays. These appear in MachineMetrics Data Mapping as items named
MacroRange1throughMacroRange6, each containing hundreds of values representing a contiguous block of macro variable addresses.
If you see MacroRange items in your Data Mapping tab, your machine uses Method 2.
[haas-macrorange-data-mapping.png placeholder]
Understanding MacroRange Layout
Each MacroRange covers a contiguous block of macro variable addresses. The ranges follow this pattern, based on Haas NGC variable numbering (where legacy 3-digit variables like #151 are stored internally as #10151):
| MacroRange | Variable Range (Legacy) | Variable Range (NGC) | Notes |
|---|---|---|---|
| MacroRange1 | #1–#33 | #1–#33 | Local/call arguments — typically NaN when no program is running |
| MacroRange2 | #100–#199 | #10100–#10199 | General purpose + probe values |
| MacroRange3 | #200–#399 | #10200–#10399 | General purpose |
| MacroRange4 | #400–#599 | #10400–#10599 | General purpose + probe calibration |
| MacroRange5 | #600–#799 | #10600–#10799 | General purpose |
| MacroRange6 | #800–#999 | #10800–#10999 | General purpose |
The exact boundaries may vary between machines. If you are unsure which range contains a variable, pull http://[machine-ip]:8082/probe and inspect the MacroRange startIndex attributes in the XML response.
Finding the Index for a Specific Variable
The index of a macro variable within its MacroRange is calculated as:
index = variable_number - range_start
Example: To find macro variable #531:
#531falls in MacroRange4 (starts at 400)- Index = 531 − 400 = 131
You can verify by inspecting the live value string in Data Mapping — count to position 131 (0-based) in the comma-separated list to confirm the expected value is present.
Reading a MacroRange Variable in an Adapter Script
Use pattern-match with a regex that skips the first N comma-separated values:
var531:
- source: MacroRange4
- pattern-match:
pattern: /^(?:[^,]*,){131}([^,]+)/
group: 1
The {131} skips 131 values (0-based) to land on index 131. Adjust the number and source MacroRange for any variable you need.
Related Articles
- Next Gen Control — adding the secondary serial connection that carries these variables
- Classic Control — Classic controls read them over the primary serial connection
- DPRNT — the alternative, where the program prints the value instead