← Resources
Fundamentals·6 min read·

What a PLC is, for people arriving from software

An industrial computer with an unusual execution model, and the constraints that explain every design decision in it.

Short answer

A programmable logic controller is an industrial computer that runs one program in an endless loop, reading inputs and writing outputs on a fixed cycle, with no operating system scheduling in the way. It is built for determinism and for twenty years of uninterrupted operation, which explains almost every difference from a general-purpose computer.

PLC scan cycleRead inputsSolve logicWrite outputsHousekeepingRepeat1-20MILLISECONDS

If you arrive from software, the strange part is not the languages. It is the execution model.

One program, forever

There is no process list. One program runs, in a loop, from the moment the controller is switched to RUN until it is switched out. Read inputs, solve, write outputs, repeat.

No scheduler decides when it runs. Nothing preempts it. The loop is the whole system.

Why determinism is the point

A general-purpose computer optimises for average throughput. A controller optimises for predictable worst case, because a machine that is usually fast enough is a machine that occasionally is not, and occasionally is where the injuries are.

Twenty years, not three

A controller specified today may still be running in 2046. That shapes everything: available spares, backward compatibility, conservative firmware, and a strong preference for boring technology.

This is also why the industry moves slowly, which looks like inertia from outside and is mostly a rational response to the cost of being wrong.

What surprises software engineers most

There are no threads, memory is often statically allocated, recursion is frequently prohibited, and dynamic allocation is avoided entirely. All of these are deliberate: each one removes a source of non-determinism.

Common questions

What makes a PLC different from a normal computer?
Determinism and lifespan. A PLC runs one program on a fixed cycle with no operating system deciding when it gets CPU time, so the timing is predictable. It is also built to run for decades in heat, vibration and electrical noise, with I/O rated for industrial voltages.
Do PLCs have an operating system?
They have firmware that manages the scan cycle, I/O and communications, but not a general-purpose operating system with a scheduler competing for CPU. That absence is the point: nothing preempts the control program, so its timing can be relied on.

Keep reading