# CNC OEE data collection with FANUC FOCAS

> PLCGateway reads run state, program number, alarms and spindle load from FANUC controls over FOCAS Ethernet and turns them into availability, cycle counts and OEE – without extra sensors, Fwlib or a Windows PC.

A FANUC control already knows what OEE needs: whether a program is running, which program it is, and whether an alarm or the emergency stop is active. PLCGateway reads these values cyclically over FOCAS Ethernet and records them, and its production model derives running time, stops and produced parts from them.

The machine is defined once as a CNC in the production model: the running signal, a part counter read from a parameter or a macro variable, and the ideal cycle time per program. From then on the Production page and the reports show availability, performance, quality and OEE for each machine, shift and day.

- **Source:** [FANUC FOCAS](https://plcgateway.com/protocols/fanuc-focas.md) (`focas`)
- **Connection:** FOCAS Ethernet · TCP 8193
- **Target:** [OEE and production model](https://plcgateway.com/oee-production.md)
- **Included in:** PLCGateway SCADA, PLCGateway Embedded

## Set it up in five steps

1. Enable the embedded Ethernet port of the CNC and FOCAS (port 8193) in the Ethernet settings of the control.
2. Add a FOCAS device with the IP address of the CNC.
3. Create the tags (status, positions, spindle, alarms, macros) or let an AI assistant create a standard machine set.
4. Open the Production page, add a machine of the type CNC and bind the running signal, the part counter and the ideal cycle time.
5. Check the preview with real data, save, and follow availability, performance, quality and OEE per shift on the Production page and in the reports.

## Example: the tags behind the OEE figures

A device with the id cnc1 and tags like these are enough for availability and cycle counting. Names and values are examples.

| Tag | Address | Example value |
|---|---|---|
| `Running` | `status.running` | true |
| `SpindleSpeed` | `spindle.speed` | 8000 rpm |
| `SpindleLoad` | `spindle.load` | 42 % |
| `Program` | `prog.main` | 1234 |
| `AlarmActive` | `alarm.has` | false |

## OEE from the machine's own signals

In PLCGateway SCADA each machine is defined once in the production model: the running signal, the counter that counts the parts, the ideal cycle time and, where available, good and reject counts. Availability, performance, quality and OEE are then calculated from the recorded history for any period, shift or day.

Operators choose downtime reasons on a screen, and the same figures appear on the Production page, in report dashboards and in the answers of an AI assistant connected over MCP.

- Machine editor in five steps, with a preview of the figures from real data
- Ideal cycle time per program or product, not only per machine
- Downtime reasons and planned stops from operator screens or machine signals
- Report dashboards per day, week or shift, exported as CSV, PNG or PDF

![Production page: machines with output, OEE, availability, performance and quality](https://plcgateway.com/assets/img/shots/production-1600.webp)

## Controllers and devices

- [FANUC FOCAS](https://plcgateway.com/protocols/fanuc-focas.md)
- [FANUC CNC](https://plcgateway.com/controllers/fanuc.md)

## Questions and answers

### Which FOCAS signals are used for OEE?

Typically status.running as the running signal, the program number to choose the ideal cycle time, a part counter from a parameter or a macro variable, and alarm.has or the emergency stop to explain stops. Spindle load and feed add detail for analysis.

### How are good and reject parts counted?

A CNC counts cycles, not quality. Rejects are entered by the operator on a screen or come from a measuring station; without them PLCGateway reports quality as not measured instead of assuming 100 %.

### How many machines can one installation monitor?

Each CNC is a device with its own connection and scan cycle; a single PLCGateway usually covers a whole shop floor, and FANUC, Haas and MTConnect machines appear side by side.

## Related solutions

- [FANUC FOCAS to MQTT](https://plcgateway.com/solutions/fanuc-focas-to-mqtt.md)
- [FANUC FOCAS to OPC UA](https://plcgateway.com/solutions/fanuc-focas-to-opc-ua.md)
- [Haas CNC OEE](https://plcgateway.com/solutions/haas-oee.md)
- [CNC OEE with MTConnect](https://plcgateway.com/solutions/mtconnect-oee.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/solutions/fanuc-focas-oee
