I recently worked on a mixed‑model assembly line that was consistently missing its OEE target despite relatively fast individual machines. The culprit was subtle: PLC scan cycles that ballooned unpredictably under certain model mixes, causing missed pick‑and‑place windows, increased product rejects and unplanned stops. In this article I’ll walk you through how I recovered lost OEE by retrofit‑tuning PLC scan behavior — the practical, low‑risk steps I used, what to measure, and the programming / architecture changes that deliver the most immediate returns.
Why PLC scan cycles matter in mixed‑model lines
When a line produces multiple models with differing I/O activity, the PLC doesn’t behave like a steady metronome. Scan time increases when heavier logic executes, large data structures are handled, or blocking instructions are hit. In sequential machine coordination and motion windows, that variable latency becomes lost time — conveyor indexing delays, missed servo positions, and extra rejects. For mixed‑model lines, variability is the enemy of rhythm.
OEE (Availability × Performance × Quality) suffers in three direct ways:
Availability: unpredictable scan spikes cause PLC timeouts or safety interlocks to trigger stops.Performance: longer cycle times reduce throughput and create bottlenecks when takt is tight.Quality: late actuation or missed checks increase rejects and rework.How I assess the problem — measurement comes first
Before changing code or hardware I measure. You can’t optimize what you don’t quantify. Here’s a short practical checklist I use on site:
Log PLC scan time continuously for at least a full production shift with actual model mix; sample at PLC‑level if available (Rockwell Logix, Siemens S7 diagnostics, Omron Sysmac provide scan diagnostics).Correlate scan spikes with model identifiers and the line events (e.g., vision inspections, recipe loads, recipe conversions).Capture CPU usage, network traffic on industrial Ethernet (Profinet/CIP/Ethernet/IP) and SMB traffic to HMI/SCADA.Record the cycle time of critical axes or pick‑and‑place tasks using motion encoder feedback or a digital marker.Note PLC program regions executing during spikes (use timestamped trace or force watches).With that data you’ll see patterns — for example, scan time jumps when a particular product triggers a long string parsing routine, or when recipe downloads occur on changeover.
Retrofit strategies that deliver fast OEE recovery
Here are the practical interventions I’ve used. Each one is ordered roughly by risk and speed-to-benefit:
Move time‑critical code to interrupt or timed tasks — Many PLC platforms let you create high‑priority or periodic tasks that preempt the default continuous scan. Move I/O handling, pick‑and‑place interlocks and motion watchdogs into a deterministic task (e.g., a 2–5 ms periodic task). This isolates them from heavy background processing.Split logic by model family — Instead of one monolithic program that handles every model path, partition code into model‑specific blocks called only when that model is active. Use a lightweight dispatcher to call the block. This avoids executing unused logic.Avoid blocking instructions on the main scan — Functions like “WAIT”, long COM timeouts, large file I/O, or synchronous recipe parsing can pause the scan. Replace blocking comms with asynchronous patterns or move them to background tasks.Streamline data structures — Large UDTs, arrays and frequent read/writes of big tags inflate memory operations. Keep only essential tags in the main scan. Use pointers or indexed access for large datasets.Use local I/O for time‑critical signals — Network I/O can add unpredictability. For sensors/actuators that define the rhythm, locate them on the CPU chassis or a deterministic remote I/O segment.Optimize HMI/SCADA polling — HMIs that poll many tags at high rates can steal CPU cycles. Reduce polling rates for non‑critical displays and use alarm/event driven updates for infrequent data.Batch non‑urgent communications — Group recipe writes, historical logging and engineering data uploads to scheduled windows or low‑priority tasks instead of doing them inline during production cycles.Leverage motion controllers where appropriate — Offloading trajectory generation to dedicated motion controllers (Siemens Sinamics, Rockwell Kinetix, Beckhoff EtherCAT drives) removes high‑frequency math from the PLC scan.Example changes and expected impact
On the line I mentioned earlier I implemented three focused changes: moved critical I/O into a 5 ms high‑priority task, separated model‑specific logic, and reduced HMI polling for non‑essential tags. Results across one week:
| Metric | Before | After |
| Average PLC scan time | 12 ms | 5.2 ms |
| Scan spikes (>30 ms) | 25 events/hour | 2 events/hour |
| Throughput (units/hour) | 420 | 480 |
| Reject rate | 3.8% | 1.5% |
Those changes recovered roughly 10–12% of lost throughput and cut stops caused by timing faults in half. The investment was limited to code changes and a short validation window — no hardware swap.
Practical code tips for common PLC platforms
Different platforms have different primitives; here are actionable pointers:
Rockwell (Logix 5000): Use the Task Configuration to create periodic and continuous tasks; use the Message instruction with "Unsolicited" or "Buffered" modes for asynchronous comms; use Local Tags and Edit‑in‑Place to minimize tag overhead.Siemens (TIA Portal / S7‑1500): Use cyclic OBs with high priority and relocate non‑time‑critical code to background OB35/121; use optimized data blocks (DBs) and avoid frequent DB reads from HMI.Beckhoff (TwinCAT): Leverage the multicore scheduling options and map high‑frequency tasks to specific cores; push motion to NC tasks for deterministic timing.Testing and validation — don’t rush to production
After code changes, I run these validation steps:
Unit test each model path in a staging environment with simulated I/O to ensure no logic regression.Run a pilot shift with the actual model mix and log scan time and motion timing for two full shifts.Verify safety interlocks and fail‑safe behavior; high‑priority tasks must not bypass safety checks.Measure OEE and reject rates daily for a week and compare to baseline.Common pitfalls and how to avoid them
Be mindful of:
Over‑prioritizing everything: Creating too many high‑priority tasks can lead to jitter and starvation of background services. Only move truly time‑critical code.Hidden side‑effects: Changing task timing can alter scan order; ensure state machines don’t rely on implicit sequencing across cycles.Ignoring network topology: Offloading to remote nodes helps only if network latency and determinism are acceptable. Diagnose and correct network issues first.A short checklist to get started this week
Record and baseline PLC scan time across a full shift with real model mix.Identify the top 3 events correlated with scan spikes.Move the most critical I/O and motion logic into a periodic high‑priority task.Isolate model‑specific logic and prevent unnecessary execution.Reduce HMI polling and batch background communications.Run a controlled pilot and compare OEE, cycle time and rejects to baseline.If you follow these steps you’ll probably recover the "low‑hanging" OEE lost to PLC timing with minimal hardware changes. For lines with more complex timing constraints, the next steps are selective hardware upgrades (dedicated motion controllers, faster CPUs) or architectural changes (segmented control with device-level controllers). If you’d like, I can walk you through a tailored checklist for your PLC brand and controller model — send me the controller family, program size and a short description of the problem behavior and I’ll suggest prioritized interventions.