industrial//industrial automation//PLC//scan cycle

The scan cycle is the loop a PLC repeats forever, from reading its inputs to updating its outputs and back.


The scan cycle is the loop a PLC repeats forever, from reading its inputs to updating its outputs and back.

1Read the inputs2Execute the program3Update the outputs4Do communications and diagnostics

One pass can take from microseconds to tens of milliseconds depending on the controller and the program size. What matters is that the pass is bounded, more than that it is fast: every scan, every input is sampled and every output is refreshed. The scan is a sampling period imposed by the controller: the plant is continuous, the PLC sees it and acts on it once per scan, which is the discretization step that fixes the loop's time base.

Inputs are read once at the start of the scan into an image table, so the logic sees a consistent snapshot; outputs are written once at the end. A signal shorter than one scan can be missed unless the hardware latches it or an interrupt task exists.

This loop is what makes classic automation predictable, and it is the concrete form of determinism: a condition gets a response within a known number of scans, never at some unspecified later time. The worst case is about two scans, before input filters and module delays: an input that changes just after the read waits almost a whole scan to be seen, and the result waits for the output write at the end of the next one.

Within those millisecond cycles the PLC closes real loops (temperature, pressure, level, position), each a PID block executed once per scan, so the scan time is also the loop's sampling period and its delay. That is why a fast position loop leaves the PLC for a servo drive or a motion controller, while a temperature loop with a time constant of minutes is comfortable at 100 ms (sampling rate selection). It is the single-task case of the periodic task model of real-time computing.

The IEC 61131-3 program is what runs in the middle of the loop; the PLC hardware does the rest.

scan time10 ms pulses missed3 of 10 response11 ms to 15 ms With a 10 ms scan and 6.0 ms pulses, 3 of 10 pulses are never seen; the ones seen reach the output 11 ms to 15 ms after their edge (one to two scans).