Popular plc programmingladder logicPLC tutorial for beginnersIEC 61131-3industrial automationPLC timers
Article

The PLC Scan Cycle Explained: Process Image, Scan Time and Response Time

How the PLC scan cycle works: input image, program scan and output update, how to measure scan time, worst-case response time and why short pulses get missed.

The PLC Scan Cycle Explained, Bob Teaches Tech featured image

The PLC scan cycle is the loop every PLC runs continuously: read all inputs into memory, execute the program from top to bottom, write the results to the outputs, handle communications and diagnostics, then start again. One pass is a scan, and the time it takes, the scan time, is usually a few milliseconds; it decides how quickly the PLC can react and which short signals it can miss.

In this guide to the PLC scan cycle I will go through each stage, show how to measure scan time on Siemens, Allen-Bradley and Mitsubishi, work out a real response time, and explain the programming mistakes the scan cycle causes and how to avoid them.

The four stages of the PLC scan cycle

  1. Input scan. The PLC copies the state of every input terminal into an area of memory called the process image input table (PII), sometimes just the input image.
  2. Program scan. The program runs from the first rung to the last, left to right within each rung. Every contact reads the input image, not the live terminal, so an input cannot change halfway through the scan.
  3. Output scan. The results in the process image output table (PIQ) are copied to the output terminals all at once.
  4. Housekeeping. Communications with HMIs, programming software and networks, plus self-diagnostics. Then the cycle repeats.

The process image is the key idea. Because the program works on a snapshot, every rung in one scan sees the same input values, and outputs only change at a defined moment. That makes ladder logic predictable, but it also means the PLC never reacts instantly. I gave a short version of this in my ladder logic tutorial; this post goes deeper.

What is PLC scan time, and how do you measure it?

Scan time (also called cycle time) is the time for one complete scan. It depends on program size, the instructions used, the CPU, and communication load. A small program on a modern compact PLC often scans in a few milliseconds; a large program with a lot of maths and communication can take tens of milliseconds. Scan time varies from scan to scan, so always look at the maximum, not just the current value.

Platform Where to read scan time
Siemens S7-1200 / S7-1500 (TIA Portal) Online & diagnostics → Cycle time: shortest, current and longest
Allen-Bradley Logix (Studio 5000) Task properties → Monitor tab: maximum and last scan time
Mitsubishi FX Special registers D8010 (current), D8011 (minimum), D8012 (maximum), in 0.1 ms units

Every PLC also has a watchdog. If a scan takes longer than the configured maximum (150 ms by default on the S7-1200, 500 ms by default for a Logix continuous task), the CPU raises a fault and can go to STOP. An endless loop in structured text is the classic way to trip it.

Response time: how fast can a PLC react?

PLC scan cycle timeline over three 10 ms scans showing input read, program, output write and communications phases, an input change filtered by 6.4 ms, picked up at the start of scan 2 and written to the output at the end of scan 2
Figure 1. One input change travelling through the scan cycle. Worst-case response is about the filter time plus two scans.

Follow one input change through the cycle. If the input changes just after the PLC has read its inputs, it is not seen until the next input scan. The program then acts on it, and the output terminal only changes at the end of that second scan. So the worst-case response time is:

Response time ≈ input filter delay + 2 × maximum scan time + output switching delay

Worked example

  • Digital input filter: 6.4 ms (the S7-1200 default; configurable).
  • Maximum scan time: 10 ms.
  • Transistor output switching: well under 1 ms. A relay output takes several milliseconds more; check the datasheet.
  • Worst case: 6.4 + 2 × 10 + about 1 ≈ 27 ms with a transistor output, roughly 35–40 ms with a relay output.

For a conveyor diverter, 27 ms is fine. For a reject gate that must hit a product moving at 2 m/s, 27 ms is 54 mm of travel, so you need to allow for it in the mechanical design or use faster techniques, covered below.

Why short pulses get missed

Diagram of PLC input reads every 10 ms: a 25 ms pulse is seen, a 4 ms pulse falls between two reads and is missed, a 9 ms pulse is caught only because it spans a read
Figure 2. Inputs are read once per scan, so a pulse shorter than the scan time can be missed.

Inputs are sampled once per scan. A pulse that starts and ends between two input reads never reaches the input image, so the program never sees it. On top of that, the input filter suppresses any pulse shorter than the filter time.

The rule: a pulse is only guaranteed to be seen if it is longer than the maximum scan time and longer than the input filter time. Some real examples:

Signal Speed and size Pulse width With a 10 ms scan
Box on a conveyor 200 mm box at 1 m/s 200 ms Always seen
Cam on a shaft 30° cam at 300 rpm about 17 ms Seen, small margin
Tab on a web 10 mm tab at 1 m/s 10 ms Unreliable
Encoder pulse 1000 pulses per second 0.5 ms Mostly missed

For signals like the last two, ordinary inputs are the wrong tool:

  • High-speed counter (HSC) inputs count pulses in hardware, independent of the scan. This is how encoders are read.
  • Hardware interrupts run a short block of code the instant an input changes, then return to the main program.
  • Shorter input filters: most PLCs let you reduce the filter per input. Do it only for clean, fast signals, because the filter is also what rejects contact bounce and noise.
  • Immediate I/O: reading or writing a terminal directly in the middle of the program, such as the 😛 suffix on Siemens addresses (%I0.0:P), the IOT instruction on Logix, or REF on Mitsubishi FX.

How the scan cycle affects your ladder logic

Rung order matters

A bit written on rung 10 can be read on rung 11 in the same scan, but rung 9 will only see it on the next scan. Usually harmless; occasionally it is the reason a one-scan pulse is missed by logic placed above it. The traffic light ladder program depends on this: the timer rung must sit above the rung that advances the step.

The last write wins

If two rungs drive the same coil, the output takes whatever the lower rung wrote, because the output scan only happens after the whole program. This “double coil” bug looks like the first rung does nothing. Combine the conditions into one rung, or use set and reset coils deliberately.

Edges last exactly one scan

A rising-edge (one-shot) contact is true for one scan only. Any logic that needs to see it must be in the same scan, below it. This is also why a timer’s done bit used to advance a counter or step should be edge-triggered, or the value advances on every scan the bit stays on.

Not every PLC uses a strict process image

Siemens, Mitsubishi and most compact PLCs follow the read–execute–write cycle above. Allen-Bradley ControlLogix and CompactLogix update I/O asynchronously, at each module’s requested packet interval (RPI), so an input tag can change in the middle of a program scan. If your logic reads the same input on several rungs and must see one consistent value, copy the inputs to internal tags at the start of the routine and use those copies.

Keep scan time under control

  • Do heavy maths, data logging and string handling in a slower cyclic task or cyclic interrupt (for example OB30 on Siemens), not on every scan.
  • Run PID loops in a fixed-interval task so their timing is constant, whatever the main scan does.
  • Avoid loops in structured text that depend on external data; bound every FOR and WHILE.
  • Check the maximum scan time after every major change, and keep a margin below the watchdog.

Test it yourself

In the Ladder Lab simulator, or any simulator from my list of free PLC simulators, write two rungs that drive the same coil and watch which one wins. Then put a one-shot above and below the rung that uses it and see the difference. On real hardware, read the maximum scan time, then make a counter count a fast push-button and see how quick you have to be before presses start going missing.

Frequently asked questions

What is the scan cycle of a PLC?

The continuous loop a PLC runs: read inputs into the input image, execute the program top to bottom, write the output image to the outputs, then handle communications and diagnostics before starting again.

What is a typical PLC scan time?

Often a few milliseconds for small and medium programs on modern PLCs, and tens of milliseconds for large programs. Always check the maximum value on your own system.

What happens if the scan time is too long?

Response slows and short inputs get missed. If it exceeds the watchdog setting, the CPU raises a fault and may stop.

How do I make a PLC respond faster?

Shorten the scan by moving heavy work to slower tasks, reduce the input filter for clean signals, use transistor outputs instead of relays, and use high-speed counters, interrupts or immediate I/O for time-critical signals.

Why does my PLC miss short input pulses?

Because inputs are read once per scan and filtered. A pulse shorter than the scan time or the filter time can fall between reads. Use a high-speed counter or an interrupt input.

Keep going

Want the next tutorial in your inbox? Join the newsletter, or download the free eBook Introduction to Ladder Logic Programming and I/O Configuration from the resources library. For timing-based logic, see PLC timers: TON, TOF and TP. Default filter and watchdog values above are from the S7-1200 system manual; check your own CPU’s documentation.

About The Author

Stuck on a step? Ask here

Include your PLC model and software version if you can. Your email is never published.