You can build OEE from a handful of PLC signals. The two you must have are a producing state and a good-part counter. Add rejects, fault codes, mode, speed and the order ID for the full picture. Build states from several bits, not one, and handle counter rollover.
The signals, one by one
A PLC holds many values. OEE needs only a few.
The skill is picking the right bit and knowing what it really means. Here are the seven that matter, in order of importance.
| Signal | Usual form | Used for | Watch out for |
|---|---|---|---|
| Run or producing | Bit (true / false) | Availability | A motor "run" bit is not the same as producing |
| Good count | Counter (integer) | Performance, quality | Rollover, resets at order change |
| Reject count | Counter (integer) | Quality | Counted once or twice? |
| Fault or alarm | Bit or code word | Stop cause at machine level | Many codes, few real causes |
| Mode (auto, manual, setup) | Bit or integer | Planned vs unplanned time | Manual mode may still be producing |
| Speed or cycle time | Real or integer | Performance | Setpoint vs actual |
| Order or recipe ID | Integer or string | Rates and cost by product | Changes before the machine does |
If you can read only two, read the producing bit and the good counter. Everything else improves the picture but is not needed for a first OEE number. See what is machine monitoring.
Building states from bits
One bit rarely tells the truth. A state is a rule over several bits. Example rules for a packing machine:
| Auto mode | Run bit | Fault bit | Count rising | State |
|---|---|---|---|---|
| Yes | Yes | No | Yes | Running |
| Yes | Yes | No | No for 3 ideal cycles | Stop, starved or blocked |
| Yes | No | No | No | Stopped, no fault |
| Yes | No | Yes | No | Fault |
| No (setup) | Any | Any | Any | Planned stop, setup |
The second row is the important one. The machine says it is running, but nothing comes out.
Without the count test, that time counts as good. With it, the loss shows up as a stop you can chase.
This is the same trap as in retrofit sensors for OEE with a current clamp.
Example: a counter that rolls over
Many PLCs hold a counter in a 16-bit word. An unsigned one counts from 0 to 65,535, then wraps to 0.
A report that just subtracts the start from the end will go negative.
Example: at the start of the shift the counter reads 64,900. At the end it reads 1,350.
Parts after the wrap: 1,350
Parts made: 636 + 1,350 = 1,986
Naive result: 1,350 - 64,900 = -63,550 (wrong)
Better still, ask the PLC programmer for a count that resets at the order start, or compute deltas on every read and keep the running total outside the PLC.
Example: how often to read
Example: a line has 30 short stops in a shift, each 20 seconds long. A system that reads the run bit once every 60 seconds sees a given stop only if a read lands inside it.
That chance is 20 / 60, about one in three.
Stops seen: about 30 x 33% = 10
Stops missed: about 20, or 20 x 20 s = 400 s = 6.7 min
Share of a 480 min shift: 6.7 / 480 = 1.4%
The fix is to read every second or two, or to let the PLC time-stamp changes of state and send each one. Then every stop is seen, even the 5-second ones. See micro-stops for why those matter.
Turning fault codes into causes
A fault word may hold dozens of codes. Do not copy them all to a report.
Map them to a short list of causes people understand.
| PLC fault code (example) | Meaning on the machine | Reason on the report |
|---|---|---|
| 12 | Infeed photo-eye blocked too long | Jam at infeed |
| 27 | Sealer temperature out of range | Process out of range |
| 31 | No film detected | Waiting for material |
| 44 | Guard door opened | Operator intervention |
Codes are a start, not an answer. Many causes are not faults at all: waiting for a forklift, a missing label roll, a lunch break.
Those need an operator choice. See downtime reason codes.
How to read the signals safely
A copy of the values, not write access. The MES should never change a setpoint.
Write each tag with its address, type and what a "1" means. The controls team usually has this.
OPC UA, Modbus TCP, EtherNet/IP and PROFINET are common routes. Use what the PLC supports.
Read often enough to catch your shortest stop. Do not flood a busy PLC.
Run one shift with a person watching. Compare each state change with what happened.
Common mistakes
- Trusting the name of a tag. "Machine_Running" may mean the motor contactor is on. Test it.
- Ignoring the PLC clock. PLC clocks drift and may use another time zone. Use one clock for all records.
- Counting what enters, not what leaves. Use the count at the end of the machine, after rejects and rework are removed.
- Changing the PLC program without telling the data team. A moved tag or a new counter breaks the OEE feed silently. Agree a change note.
- Skipping the line view. A machine can be fine and still wait for the machine before it. See line OEE vs machine OEE.
- Not agreeing on the ideal rate. The count alone does not give performance. You need a rate to compare it with. See ideal cycle time.
The OEE math is in how to calculate OEE, and PLC fault problems are listed in PLC controls troubleshooting. For method choices, see OEE data collection methods.
Fabrico reads stops, speed and counts live from PLCs, then operators tag the cause at the line, so a fault code becomes a reason people understand. See how Fabrico reads PLC data.
What people ask next
Which PLC signals do I need for OEE?
At least a producing state and a good count. For quality add a reject count. For stop analysis add the fault word and the mode. For rates add the order or recipe ID.
Will reading PLC data affect the machine?
Reading should be read-only, at a sensible rate, through a path the controls team approves. A heavy poll on a busy PLC can slow it, so ask the controls team about load.
What if the PLC has no good-part counter?
Add a part sensor, or count a cycle bit. See retrofit sensors for OEE.
How do I deal with counter rollover?
Compute the difference between reads using modular math, and check the counter width, 16 or 32 bit. Or reset the count at each order start.
Do fault codes give me the cause of every stop?
No. They cover machine faults only. Waiting, changeover and operator actions need another source. See how to track downtime.
Related guides: ISA-95 Levels Explained: From Sensors to ERP · Modbus Machine Data for OEE: Registers and Polling · MES OPC UA Integration: Setup and Common Traps · MES PLC Integration: Routes, Tag List and Tests