
MFG · Manufacturing
Learn OT · Lesson 2.2
What is a PLC? How a programmable logic controller works
The most important computer in a factory has no screen, no keyboard and often no password.
In short
A PLC (programmable logic controller) is a rugged industrial computer that runs a machine or process. It reads inputs from sensors, runs a program, and sets outputs to actuators, repeating this scan cycle every few milliseconds. PLCs replaced relay wiring in the late 1960s and now run most automated equipment.
The brain of a machine
A PLC is the brain of a machine. It sits in a cabinet next to the equipment, wired to sensors on one side and actuators on the other. It has no screen of its own. People see what it's doing through an HMI (Lesson 2.6) and change its program from an engineering workstation (Lesson 2.7).
Read, think, write, repeat
It repeats one cycle, called the scan, over and over:
- Read inputs. Take a snapshot of every sensor: which switches are on, what each measurement says.
- Run the program. Work through the logic from top to bottom.
- Write outputs. Switch motors, valves and lights on or off according to the result.
- Housekeeping. Talk to the network, run checks. Then start again.
A full scan typically takes a few milliseconds to tens of milliseconds. Because it repeats in the same order every time, a PLC's behaviour is predictable, which is exactly what a machine needs.
Drawn like wiring
The most common way to program a PLC. It looks like an electrical relay diagram: two vertical rails with horizontal "rungs" between them, each rung a condition and a result. If the start button is pressed and the guard is closed and there's no fault, run the motor. It was chosen so that electricians who knew relay diagrams could read the program. Other languages exist, defined in the IEC 61131-3 standard, including structured text and function block diagrams.
Four boxes on a rail
- CPU module: runs the program.
- I/O modules: the inputs and outputs wired to field devices. "I/O" is the plant's word for these connections.
- Communication modules: for the network and other devices.
- Power supply and rack that hold it together.
Small machines use compact PLCs with everything in one box. Large lines use modular racks with dozens of I/O cards.
Every big name, often on one floor
Large manufacturers include Siemens, Rockwell Automation (Allen-Bradley), Schneider Electric (Modicon), Mitsubishi Electric, Omron and ABB, among many others. A single plant commonly has several brands because each machine builder chose their own.
Whoever holds the program holds the machine
Three reasons. Many PLCs accept a new program or a command from anyone who can reach them on the network. Their firmware is rarely updated. And whoever controls the program controls the machine. Stuxnet (Lesson 5.1) worked by quietly changing PLC programs while showing operators normal readings.
A practical first step on any site: know every PLC, its firmware version, who can program it, and whether a current backup of its program exists.
On a real site
On a bottling line, the PLC for the filler is in a grey cabinet beside it. Inside, a small label shows the CPU model. The program was last changed two years ago by the machine builder's engineer, from his own laptop. The plant has a copy of that program, but nobody is sure if it is the latest one.
Easy to mix up
"A PLC is the same as SCADA." No. The PLC runs the machine. SCADA watches and supervises many PLCs from a control room. If SCADA goes down, the PLCs usually keep running.
Check yourself
Name the steps of a PLC scan.
Read inputs, run the program, write outputs, housekeeping, then repeat.
Why was ladder logic designed to look like relay diagrams?
So electricians who already knew relay wiring could read and maintain the program.
Where do people usually change a PLC's program from?
An engineering workstation or a technician's laptop running the vendor's software.
Questions people ask
What is a PLC used for?
Running machines and processes automatically: conveyors, packaging lines, pumps, mixers, presses and much more.
Is a PLC a computer?
Yes, a specialised, rugged computer built to run one control program reliably for years.
What is the difference between a PLC and a DCS?
A PLC usually controls one machine or area; a DCS controls a whole continuous process from one integrated system. The line between them has blurred.
Terms in this lesson
Go deeper · from our learning shelf
ICS/SCADA Fundamentals Cybrary · free tier
Basic ICS protocols and SCADA components.
Introduction to the World of OT/ICS TryHackMe · free room
How OT works, hands-on, in your browser.
Programmable Logic Controllers On our bookshelf · Frank D. Petruzella
The standard first textbook on PLCs: hardware, ladder logic, timers, counters and installation.
See the whole learning shelf: free courses first, then the certificates worth paying for →
Useful? Send it to someone who works near a plant room. Learn OT is free to read, share and teach from.
Keep going


