Most Haas monitoring projects fail for boring reasons: a DHCP address that changes overnight, a setting nobody turned on, or a part counter that counts programs instead of parts. None of it is hard. It just needs to be done in the right order.
This is the order we follow when we connect Haas machines in the field. If you are still deciding between MTConnect, Q-codes and hardwired signals, read Haas data sources: MTConnect, Q-codes and the NGC control first.
What you will have at the end
Each Haas machine will publish, through an edge gateway to an MQTT broker:
- Status (running, idle, alarm, offline) with a timestamp for each change
- Active program name
- Part count, total and per shift
- Cycle time for each cycle, against the standard time
- Spindle speed and load, where the control publishes them
- Alarms, with raised and cleared times
A dashboard then shows live machine tiles, shift OEE and a downtime Pareto chart.
Architecture in words
Think of a simple chain:
- Haas machines on an isolated machine network with static IP addresses.
- An edge gateway with one port on the machine network and one on the plant LAN. It reads MTConnect over HTTP and Q-codes over TCP.
- An MQTT broker, on the gateway, a local server, or in the cloud over TLS (Transport Layer Security).
- A monitoring platform that subscribes to the broker, stores history and serves dashboards to browsers and phones.
Data only flows outward: machine to gateway to broker to dashboard.
Step 1: Survey the machines
For each Haas, record:
| Item | Where to find it |
|---|---|
| Model and serial number | Machine plate, or Q100/Q102 later |
| Control type (NGC or classic) and software version | Control diagnostics / About screen |
| Network port available? | Back of the control cabinet |
| Current network settings | Network settings page on the control |
| Parts per cycle for main jobs | Programmer or setter |
Parts per cycle matters more than people expect. If a fixture holds four parts, a counter that counts M30 is off by a factor of four.
Step 2: Set up the network
Give every machine a static IP address on a dedicated subnet, for example 192.168.20.0/24. Do not use DHCP on the shop floor. A changed address breaks monitoring silently, usually on a weekend.
Run a shielded Ethernet cable from each machine to a switch. Keep it away from spindle and servo power cables.
Step 3: Enable data collection on the control
On an NGC control:
- Open the network settings and confirm the static IP address, subnet mask and gateway.
- Enable MTConnect in the network settings. Note the agent port (commonly 8082).
- Enable Machine Data Collection for Q-codes (Setting 143 on many machines). Note the TCP port (commonly 5051).
- Power-cycle the control if the manual says the change needs it.
On a classic control, enable Machine Data Collection and set the RS-232 baud rate and format to match the gateway’s serial port.
Step 4: Test from a laptop
Before installing anything permanent, prove the machine answers. On a laptop on the same subnet:
ping 192.168.20.31
curl http://192.168.20.31:8082/current
The curl command should return an XML document with the machine’s current values. Then test Q-codes with any TCP terminal tool (for example a raw-mode Telnet or netcat session to port 5051), and send:
?Q500
A good reply contains the program, the status and the part count. If you get nothing back, recheck Step 3.
Step 5: Pick your tags
Keep the first list short and verified:
| Data | Source | Poll |
|---|---|---|
| Execution state | MTConnect | Stream or 1 s |
| Alarm conditions | MTConnect | Stream or 1 s |
| Program, status, parts | Q500 | 2 s |
| Last cycle time | Q303 | On cycle end |
| Parts counter | Q402 | 2 s |
| Spindle speed / load | MTConnect, or Q600 macro variable | 1 to 2 s |
| Power-on / motion time | Q300 / Q301 | 1 min |
If the programmer can add one line to each program that increments a macro variable per finished part, read that variable with Q600. It is the most accurate part counter you can get.
Step 6: Configure the edge gateway
Point the gateway at each machine’s IP and ports, then set up the logic:
- Status rules: alarm first, then running (execution active), then idle (powered, not executing), then offline (no reply for, say, 30 seconds).
- Cycle time: read Q303 when the part counter changes, so the cycle time always matches a counted part.
- Part count: count increments, not absolute values, so counter resets at shift change do not create negative production.
- Text parsing: discard blank or malformed Q-code replies rather than recording a zero.
- Store and forward: buffer data on the gateway when the broker is unreachable, and replay it in order afterwards.
Step 7: Publish to MQTT
Use one topic tree for the whole plant:
plant1/turning/haas-st20-02/status
plant1/turning/haas-st20-02/cycle
plant1/turning/haas-st20-02/alarm
A cycle message might look like this:
{
"ts": "2026-11-27T14:05:31+05:30",
"program": "O01234",
"cycle_s": 184.6,
"parts": 2,
"part_count": 562
}
Set the retained flag on status messages so a dashboard that connects later still sees the current state. Use QoS (quality of service) 1 for cycles and alarms.
Step 8: Dashboard and OEE
- Load the shift calendar and planned breaks.
- Enter the ideal cycle time for each program.
- Let operators pick a reason for each stop longer than a few minutes, and log rejected parts.
- Run one week side by side with the paper log, and fix any mapping problem before anyone acts on the numbers.
You can see what a finished view typically looks like in our virtual machine monitoring overview.
Step 9: Hand over and keep it healthy
A monitoring system is only useful if somebody owns it after the installer leaves. Before you close the project:
- Name one owner in maintenance and one in production. Maintenance owns the network and gateway. Production owns reason codes and cycle standards.
- Keep the IP sheet, port list and tag list in one shared document, next to the machine list.
- Set an alert when any machine stays offline for more than an hour during a shift. Most “the dashboard is wrong” complaints are really a disconnected cable.
- Review the downtime reasons every week for the first month. If “Other” is the biggest bar, the reason list needs work, not the operators.
- When a control software update is planned, recheck the MTConnect probe and the Q-code replies afterwards.
Troubleshooting
- MTConnect page does not load. The agent is disabled, the port is wrong, or a firewall on the laptop blocks it.
- Q-codes return nothing. Machine Data Collection is off, or another program is already holding the connection.
- Part count four times too low. M30 counts cycles. Multiply by parts per fixture or use a macro-variable counter.
- Status shows idle during long tool changes. Expected on some data items. Use execution state, not spindle speed, as the main status input.
- Machine goes offline every morning. Someone powers the machine off overnight, or the IP is still on DHCP.
- Random dropouts. Check the cable route and the switch. Unshielded cable beside servo cables picks up noise.
Conclusion
Haas monitoring comes down to a clean order: survey, static network, enable MTConnect and Q-codes, test from a laptop, keep the tag list short, put the logic in the gateway, publish to MQTT, and validate against the paper log. Do that and your Haas machines report reliably from the first week.
The same pattern works across brands. See Siemens CNC and PLC to MQTT, FANUC FOCAS and MTConnect to MQTT, Mitsubishi CNC and PLC setup and Delta Modbus gateways.
Want help connecting your Haas machines? Book a free assessment and we will show you what a gateway-based setup collects on day one.