How a PLC works: inputs, program and scan cycle
14 October 2026
A programmable logic controller (PLC) is an industrial computer built to read signals from a machine or process, run a stored program and drive outputs, reliably and for years without restart.
The scan cycle
Most PLCs repeat a cycle: read the inputs into memory, execute the program using that snapshot, write the results to the outputs, and handle communications and housekeeping. The time one pass takes is the scan time. It depends on the controller, the size and structure of the program and the communication load, so it should be measured on the real controller, not assumed.
Why the snapshot matters
- Inside one scan, the program sees the inputs as they were at the start. A signal that changes and changes back within a scan can be missed.
- Fast events are handled by dedicated hardware inputs, interrupt tasks or high-speed modules, not by the ordinary cycle.
- Many controllers also run several tasks with different priorities and cycle times.
Programming languages
The IEC 61131-3 standard defines the common PLC languages: ladder diagram, function block diagram, structured text and sequential function chart. Which one fits depends on the task. Ladder suits discrete logic that electricians read easily; structured text suits calculations and data handling; sequential function chart suits step-by-step processes.
Good practice
- Define the sequence and the safe states before writing code.
- Keep safety functions in a certified safety system. A standard PLC is not a substitute.
- Document tags, units and ranges, and test against a simulation before the plant is connected.
- Control forcing and online changes through a managed change procedure.
