What is a PLC?
A PLC (programmable logic controller) is a rugged industrial computer that reads sensors and switches, runs a control program, and switches motors, valves and lamps. Almost every machine and production line in a factory is controlled by one.
Why PLCs replaced relay panels
Before PLCs, machine logic was built from hard-wired relays, timers and counters. Changing the sequence meant rewiring the panel, and finding a fault meant tracing hundreds of wires. The first PLCs, built for the automotive industry around 1968, replaced that relay logic with a program. The program is still drawn like a relay diagram (ladder logic), so electricians can read it, but changing it takes minutes instead of days.
- Flexible: change the program, not the wiring.
- Reliable: built for heat, vibration and electrical noise, running 24/7 for years.
- Easy to troubleshoot: you can watch every input, output and rung live on a laptop.
- Compact: one small PLC replaces a cabinet full of relays and timers.
The parts of a PLC
| Part | What it does |
|---|---|
| Power supply | Usually 24 V DC (some PLCs run from 100–240 V AC). Feeds the CPU and often the sensors. |
| CPU | Runs the program, stores data (memory bits, timers, counters, data registers) and talks to other devices. |
| Input module | Reads field signals: push buttons, proximity sensors, photo-eyes, limit switches. Digital inputs see ON/OFF; analog inputs read 4–20 mA or 0–10 V. |
| Output module | Switches loads: contactor coils, solenoid valves, lamps, buzzers. Outputs are relay, transistor (sourcing or sinking) or triac types. |
| Communication | Ethernet, PROFINET, EtherNet/IP, CC-Link, Modbus and others link the PLC to HMIs, drives, robots and remote I/O. |
The scan cycle
A PLC does not run its program once. It repeats the same loop, called the scan, every few milliseconds:
- Read inputs. The CPU copies the state of every input terminal into memory (the input image).
- Run the program. It solves the ladder logic rung by rung, top to bottom, left to right, using that copy.
- Write outputs. It copies the results (the output image) to the output terminals in one go.
- Housekeeping. Communication, diagnostics and timers are updated, then the cycle starts again.
Because inputs are read once per scan, a signal shorter than one scan can be missed. That is why fast signals such as encoder pulses go to high-speed counter inputs instead of normal inputs.
RUN and STOP
In RUN mode the PLC scans the program and drives its outputs. In STOP mode the program does not run and all outputs are switched off. You download a new program in STOP (or online while running, on PLCs that allow it).
Popular PLC brands
Siemens (S7-1200, S7-1500), Mitsubishi (MELSEC FX, iQ-R), Allen-Bradley / Rockwell (MicroLogix, CompactLogix), Omron, Schneider, and JTEKT TOYOPUC. They all work the same way; the main differences are the programming software and the addressing system.
Next steps
Learn how the PLC is wired, how its addresses work and how to write ladder logic. Then try it: the PLC Sim Lab Playground lets you wire a panel and run your own program in the browser.
Watch it in the video tutorial
Starts at 0:00: the whole tutorial: build a first PLC circuit from an empty panel. Open on YouTube →
Try it yourself. Wire sensors, contactors and a PLC, write ladder logic and press RUN in the free PLC Sim Lab Playground. Nothing to install.
Open the Playground →Guided lessons →