# Haas machine data collection

> Monitor Haas mills and lathes with the built-in Machine Data Collection: status, programs, parts, cycle times, spindle and macro variables.

Haas controls answer Q commands over a TCP port when Machine Data Collection is enabled (Setting 143). PLCGateway sends these commands cyclically and turns the answers into tags: machine status, running program, part counter, cycle times, tool changes and spindle values.

Macro variables can be read and written, for example to exchange a work order number with the machine. Together with the production model PLCGateway calculates availability, output and OEE for every Haas machine on the shop floor.

- **Driver id:** `haas_q`
- **Connection:** TCP · port of Setting 143
- **Address browsing:** addresses are typed or imported
- **Writing:** yes
- **Included in:** PLCGateway Connect, PLCGateway SCADA, PLCGateway Embedded

## What PLCGateway reads and writes

- Status, busy / running state and alarms
- Running program and part counter
- Last and previous cycle time, power-on and motion time
- Tool changes and current tool
- Spindle speed and load, positions
- Macro variables (read and write)

## Address examples

| Address | Meaning |
|---|---|
| `status · running · alarm` | Machine status (Q500) |
| `program · parts` | Program and part count |
| `last_cycle · prev_cycle` | Cycle times in seconds |
| `spindle_rpm · spindle_load` | Spindle speed and load |
| `macro:500 · #500` | Macro variable 500 |
| `q:104` | Raw Q command |

## Controllers and devices

- [Haas Automation](https://plcgateway.com/controllers/haas.md)

## Connect in a few steps

1. On the machine set Setting 143 (Machine Data Collection) to a TCP port, for example 5051.
2. Add a Haas device with the IP address and the port.
3. Create the tags for status, program, parts and spindle.
4. Define the machine in the production model for availability and OEE.

## Questions and answers

### Which Haas controls are supported?

Next Generation Control (NGC) and the Classic control with Machine Data Collection over Ethernet.

### Can PLCGateway also use MTConnect on a Haas?

Yes. Haas NGC machines also offer MTConnect; both drivers are available, the Q commands give macro variable access.

### Is writing possible?

Macro variables can be written. Programs and settings are not changed by PLCGateway.

## Related protocols

- [MTConnect](https://plcgateway.com/protocols/mtconnect.md)
- [FANUC FOCAS](https://plcgateway.com/protocols/fanuc-focas.md)
- [All protocols](https://plcgateway.com/protocols.md)

_Product and model names are trademarks of their owners. They are named only to show which equipment the drivers communicate with; PLCGateway is not affiliated with these companies._

---
Source: https://plcgateway.com/protocols/haas
