Explainer
What a PLC does: scan cycle, applications and advantages
Short answer
A PLC is an industrial computer that repeats a fixed scan — read inputs, solve logic, write outputs — typically every 1-20 ms. That determinism, plus reprogrammable logic and modular I/O, is why it replaces relay panels in manufacturing, process, motion and building control, while safety functions still need rated components.
On this page
A programmable logic controller (PLC) is an industrial computer that runs one control program in a fixed, repeating loop: read every input, solve the logic, write every output, do housekeeping, start again. That loop, the scan, repeats on the order of milliseconds, so the controller samples the machine thousands of times a minute with timing you can calculate. That repeatability is what a relay panel never offered, and it is the reason PLCs run manufacturing lines, process plants, motion systems and building services. Below: how the scan works, where PLCs earn their place, the advantages that follow, a worked response-time calculation, and when relays or a dedicated controller still win.
The scan cycle #
A PLC in run mode executes the same four phases over and over:
- Input read. The controller copies the state of every input channel into an input image table in one pass. The program solves against that snapshot, so every rung in the scan sees identical input values regardless of when the physical signal arrived.
- Logic solve. The program executes from top to bottom — rung order in ladder — updating internal coils, registers and data blocks.
- Output write. The output image table is copied to the physical output circuits in one pass, so outputs change together at the end of the scan.
- Housekeeping. As part of each cycle the controller services the programming and SCADA connections, refreshes diagnostics and checks its watchdog.
Small and mid-size controllers with a modest program complete the loop in 1-20 ms; a 10 ms scan looks at every input 100 times a second. Scan time grows with program size, I/O count and communication servicing, and heavily loaded controllers can approach 100 ms. A watchdog supervises the loop: if a scan cannot finish, the controller faults and drives its outputs to their configured fault state rather than continue on stale data.
What the scan replaced #
In a relay panel, the wiring is the logic. A timer is a separate relay with its own time setting, a counter is another piece of hardware, and changing the sequence means pulling wires and re-terminating them. Every relay adds coil current, heat and a finite mechanical life, and finding a fault means walking the panel with a meter.
A PLC keeps the field wiring — sensors and actuators still land on terminals — and moves the logic into a program. Timers, counters, comparisons, math and sequencing become instructions with no panel space and no moving parts. Changing the sequence is a program edit and a download, and fault-finding starts from controller and module diagnostics instead of a voltmeter. The program itself follows IEC 61131-3, the standard that defines the software architecture and the programming languages of the PLC control program; ladder diagram is the best known of those languages.
Where PLCs are used #
| Application | What the PLC controls |
|---|---|
| Manufacturing automation | Assembly lines, material handling, packaging, in-line quality checks |
| Process control | Temperature, pressure, flow and mixing in chemical, pharmaceutical, food and beverage, water treatment and oil and gas plants |
| Motion control | Conveyors, robotics, servo axes, motor starting and stopping |
| Building automation | HVAC, lighting, access control and security |
| Energy management | Metering and switching facility energy use |
| Remote monitoring and control | Networked processes supervised from one location through SCADA |
The rows combine on real machines: a filling line is motion, process and quality control in one controller, reporting upward over an industrial network.
The advantages that follow #
- Deterministic response. Because the scan repeats, you can compute the worst-case time from a field change to an output, as the worked example below shows.
- Plant-floor hardware. Controllers and I/O are built for the temperature extremes, humidity, vibration and electrical noise of an industrial environment.
- Reprogrammable logic. Production changes are program edits, not rewiring.
- Modular expansion. Digital, analog, specialty and communication modules add onto the machine as it grows instead of replacing the controller.
- Built-in diagnostics. Module and channel status and fault codes point at the failed channel, cutting repair time from hours of meter work to reading status.
- Integration. The same controller talks to HMIs, SCADA and higher-level systems over EtherNet/IP, PROFINET, Modbus and OPC UA.
- Life-cycle cost. The first installation costs more than a small relay panel, but once logic changes, downtime and diagnosis time count, the PLC is cheaper to own.
Worked example: worst-case response time at a 35 ms scan with relay outputs #
The inputs, documented example values for a mid-size controller with a mechanical relay output:
- Digital input filter delay: 6 ms, a typical configurable filter setting on a 24 V DC input module.
- Scan time: 15 ms typical, 35 ms worst case for this program.
- Output turn-on delay: 10 ms, a mechanical relay output rather than a transistor output.
The rule in words: a field contact change reaches the load only after the input filter passes it, a scan reads it into the input image and solves the affected rungs, the end-of-scan write updates the output circuit, and the relay mechanically closes. A signal that lands just before the input-read phase costs one scan. A signal that lands just after it misses that read and costs two.
The arithmetic:
- Best case = 6 ms + (1 x 15 ms) + 10 ms = 31 ms.
- Worst case = 6 ms + (2 x 35 ms) + 10 ms = 6 ms + 70 ms + 10 ms = 86 ms.
This configuration therefore responds to a field change in 31-86 ms. The decision: if the process tolerates 100 ms, leave it as configured. Anything that must respond in under 50 ms worst case — a reject gate, a registration cut — needs all three fixes together, because the scan term alone exceeds the budget: shorten the input filter below 6 ms, replace the relay output with a transistor output to remove the 10 ms, and move the rung out of the main scan into a faster or event-triggered task; configuring controller tasks for deterministic timing is that step.
PLC, relays or a dedicated controller #
- Up to about ten simple interlocks, no timers, counters or sequencing, and no expected changes: hardwired relays stay simpler and cheaper to own.
- Any sequencing, counting, analog measurement, recipe handling or likely change: a PLC.
- Coordinated multi-axis motion: the controller itself must be motion-capable, not merely networked to drives — why a Kinetix 5500 needs a motion-capable Logix controller explains where that line sits.
- Emergency stops and guard interlocks: rated safety components validated as a complete safety function; a standard PLC program does not qualify, whatever the logic looks like.
- Sizing the hardware: start from the machine's I/O list — how to select PLC inputs and outputs from an I/O list walks that step.
Questions asked
What scan time should I expect from a small PLC?
Small and mid-size controllers typically scan in 1-20 ms with a modest program, and heavily loaded ones can approach 100 ms. The exact figure depends on program size, I/O count and communication servicing. Every major programming package shows the current and maximum scan time in the controller diagnostics, so read it there rather than assume a value.
Can a standard PLC handle emergency stops and guard doors?
No. Emergency stops and guard interlocks are safety functions and must run through components rated and validated for the required SIL or performance level as a complete function. A safety-rated PLC can do this job, but it is a certified device with a protected safety program, which is a different product class from a general-purpose controller running ladder logic.
Which programming languages does IEC 61131-3 define?
The standard defines five languages: ladder diagram, function block diagram, structured text, sequential function chart and instruction list. Ladder remains the plant-floor default because electricians read it directly; structured text suits math-heavy logic; function blocks package reusable control such as PID loops. Instruction list is deprecated in later editions of the standard, so avoid it for new programs.
Why choose a PLC over a microcontroller or an industrial PC?
A PLC is built around a deterministic scan, industrial-grade isolated I/O and enclosure-rated hardware, with vendor support measured in decades. A hobby microcontroller board offers none of that. An industrial PC is the right tool beside the controller, as a SCADA client or data server, but hard real-time field control stays on the PLC.