MTBF in manufacturing: measure it from PLC fault codes
What mean time between failures (MTBF) means on a production line, how to calculate it from machine run time and PLC fault codes, and how to use it to improve equipment reliability.

Mean time between failures (MTBF) is one of the most useful reliability measures in manufacturing. It answers a simple question: on average, how long does this machine run before it faults? A rising MTBF means the machine is becoming more reliable; a falling one is an early warning. This article explains how to calculate MTBF on a production line, why the inputs matter, and how to measure it automatically from PLC fault codes.
The formula
MTBF = productive run time ÷ number of failures
For example, if a case packer spent 32 hours in Auto Run last week and faulted 64 times, its MTBF was 30 minutes. Next week, after an adjustment to the carton feed, 34 hours of Auto Run with 34 faults would give an MTBF of 1 hour: the machine runs twice as long, on average, between faults.
On production lines, “failures” are usually faults, any stop the machine raises an alarm for, rather than only major breakdowns. That is why the measure is often called mean time between faults. It catches the frequent short stops that hurt output most.
Get the run time right
MTBF is only as good as its inputs. The most common mistake is using calendar time or scheduled time as the run time. If the machine sat idle for a two-hour material shortage, those hours didn't expose it to faults, and counting them makes it look more reliable than it is.
Use time the machine actually spent running in automatic mode. Exclude:
- idle time (ready but waiting),
- manual mode and set-up,
- planned stops and cleaning,
- offline time, when the machine couldn't be observed.
Count faults, not alarm messages
A single jam can raise several alarms in a second, and an alarm can flicker on and off. Count fault episodes: each time the machine enters a fault state, however many alarm messages come with it. Otherwise MTBF is distorted by how chatty the PLC is.
Measure it automatically from the PLC
Calculating MTBF from manual logs is close to impossible. Short faults go unrecorded and run time is estimated. Reading it from the machine is straightforward:
- The machine-state signal gives exact Auto Run time.
- Each entry into the fault state is one fault episode.
- The fault code signal says which alarm caused it, translated by that machine's own alarm code list.

Astara shows fault count and MTBF (Auto Run time ÷ faults) under the time allocation chart for any period you select, so you can compare this week with last week or one shift with another.
Auto Run since last fault
MTBF is an average over a period. On the floor, a live counter is often more motivating: how long has this machine been running since its last fault? Astara's Auto Run since last fault tile shows exactly that, along with the alarm code of the last fault and when it cleared. Idle, stopped and manual time pause the clock rather than resetting it, so it counts only real running.

Use MTBF with mean time to repair
MTBF tells you how often a machine faults; mean time to repair (MTTR) tells you how long each fault costs. Together they describe availability:
- Low MTBF, low MTTR: frequent short stops. Look at adjustment, materials and sensors.
- High MTBF, high MTTR: rare but long breakdowns. Look at spares, maintenance response and diagnostics.
- Low MTBF, high MTTR: the machine needs serious attention.

Turn it into action
- Rank fault codes by total lost time for the period.
- Pick the top code and find its root cause with operators and maintenance.
- Watch MTBF and that fault's count over the following weeks.
That loop, measured from the PLC rather than remembered, is how reliability actually improves. Read more about machine monitoring and downtime tracking in Astara, or get in touch.


