A programmable logic controller (PLC) is a rugged industrial computer that reads inputs from sensors and switches, runs a stored control program, and switches outputs such as motors, valves and lights. It repeats this read–solve–write scan continuously, usually every few milliseconds, so a machine or process behaves the same way every cycle.
If you have ever wondered why a machine on a factory floor keeps running correctly without a person watching every step, the answer is almost always a PLC. Conveyors, pump stations, packaging lines, car washes and building HVAC systems all depend on them.
What Does a PLC Controller Do?
A PLC controller sits between the field devices on a machine and the decisions that machine must make. Take a simple conveyor:
- A photo-eye (input) sees a box arrive at the end of the belt.
- The program decides what that means: "if a box is waiting and the downstream station is busy, stop the belt."
- An output de-energizes the motor starter, and the belt stops.
Nothing about that behavior is wired into relays. It lives in the program, so an engineer can change it — add a delay, count boxes, raise an alarm — without rewiring the panel. That flexibility is why "programmable" is the first word in the name.
The Parts of a PLC
Whatever the brand, a PLC system is built from the same components:
| Component | What it does |
|---|---|
| Power supply | Converts the incoming supply (often 120 VAC or 24 VDC) to the voltages the CPU and modules need |
| CPU (processor) | Runs the control program, manages the scan and reports faults |
| Memory | Stores the program, tag values, timer and counter states, and retained data |
| Input modules | Convert field signals — pushbuttons, limit switches, sensors, 4–20 mA transmitters — into data the CPU can read |
| Output modules | Drive contactors, solenoid valves, lamps and analog setpoints through relay, transistor or analog outputs |
| Communication ports | Connect to HMIs, SCADA, drives, remote I/O and other controllers over networks such as EtherNet/IP, PROFINET or Modbus |
| Programming software | Runs on a PC to write, download, monitor and troubleshoot the program |
PLCs come in two broad form factors. A compact (fixed) PLC has the CPU, power and a set number of I/O points in one housing — cheap and easy for a small machine. A modular (rack or chassis) PLC lets you add I/O, communication and specialty modules as the system grows. You will also meet safety PLCs, which are certified for safety functions such as emergency stops and light curtains; see safety PLCs for beginners. For a device-by-device tour of what connects to the I/O, browse the PLC components guide.
How a PLC Works: The Scan Cycle
Every PLC runs the same fundamental loop, called the scan cycle:
- Read inputs — the processor samples every input and stores the values in an input image table in memory.
- Execute the program — the CPU works through your ladder logic (or Structured Text) from top to bottom, evaluating conditions and setting bits in an output image table.
- Write outputs — the processor copies the output image table to the physical output terminals, energizing or de-energizing each wired device.
- Housekeeping — the CPU handles communications and self-diagnostics, and a watchdog timer faults the controller if a scan takes too long.
Then it starts again. Scan time depends on program size and CPU speed; on many controllers it is a few milliseconds to a few tens of milliseconds, so the machine sees a fresh picture of its inputs many times per second.
The scan explains most beginner surprises: why rung order matters, why a signal shorter than one scan can be missed, and why edge detection exists. Go deeper in the PLC scan cycle explained, or step through a scan yourself in the PLC scan cycle visualizer.
PLC Logic: How a Programmable Logic Controller Makes Decisions
PLC logic is Boolean logic applied to real signals. Every decision in a control program reduces to AND, OR and NOT conditions on inputs and internal bits, plus timers, counters and math. That is where the "logic" in programmable logic controller comes from.
| Logic | Ladder logic form | Structured Text form | Plain-English example |
|---|---|---|---|
| AND | Contacts in series | Run := Guard AND Start; | Run only if the guard is closed AND Start is pressed |
| OR | Contacts in parallel | Lamp := Button1 OR Button2; | Either button turns the lamp on |
| NOT | Normally closed contact | Ok := NOT Fault; | Healthy while there is no fault |
| Memory (latch) | Seal-in branch or SET/RESET coil | IF Start THEN Run := TRUE; END_IF; | Keep running after Start is released |
| Time | TON / TOF timer block | Delay(IN := Run, PT := T#5S); | Wait 5 seconds before the next step |
Combine those building blocks and you get interlocks, sequences, alarms and full machine programs. The ladder logic examples page walks through eight of the most common patterns, and the PLC codes reference explains the instruction mnemonics (XIC, XIO, OTE, TON, CTU) you will see in real programs.
Where PLCs Are Used
PLCs were created in the late 1960s to replace relay panels in automotive assembly plants. Today they control:
- Conveyor and sorting systems — directing boxes or parts based on weight or barcode reads.
- Water and wastewater treatment — opening valves, running pumps, dosing chemicals in sequence.
- HVAC and building automation — sequencing chillers, modulating dampers, managing boiler startup.
- Packaging machinery — carton erectors, case packers, labelers, palletizers.
- Process control — maintaining temperature, pressure and level with PID loops.
Anywhere a process must happen in a defined sequence, reliably, is a candidate for a PLC.
PLC vs Relay Logic vs Microcontroller vs PC
The PLC is easiest to understand next to the alternatives it competes with:
| PLC | Hardwired relay logic | Microcontroller board | Regular PC | |
|---|---|---|---|---|
| How logic changes | Edit and download the program | Rewire relays and timers | Rewrite and reflash firmware | Change the application |
| Industrial I/O | Plug-in modules for 24 VDC, 120 VAC, 4–20 mA | Relay coils and contacts | You design the protection and interface circuits | Needs add-on I/O hardware |
| Timing | Deterministic, repeating scan with a watchdog | Fixed by wiring; each relay takes milliseconds to switch | Deterministic if written carefully | General-purpose OS scheduling |
| Environment | Built for panel temperature, vibration and electrical noise | Industrial panels | Depends on your board and enclosure | Office-grade unless it is an industrial PC |
| Maintenance | Online monitoring and diagnostics that technicians can read | Trace wires with a meter | Needs the original developer's tools | IT-style support |
| Best fit | Machines and processes that change and must be maintained for years | Very small, fixed circuits and hardwired safety | High-volume products where the logic rarely changes | Data, visualization and supervisory software |
A PLC trades raw computing power for determinism, ruggedness and maintainability: it responds to inputs within a bounded scan, and a technician can watch the logic live while the machine runs.
PLCs originally replaced banks of hardwired relays, and the advantages still hold: logic lives in software you can change without rewiring, in a fraction of the panel space. For the chip-level comparison, read PLC vs microcontroller.
A Short History of the PLC
In 1968 General Motors' Hydramatic division asked for an electronic replacement for the hardwired relay systems that had to be rebuilt at every model change. Bedford Associates won the proposal and in 1969 delivered the Modicon 084 — often called the first PLC. Dick Morley, who led that work, is widely called the father of the PLC. Relay-style ladder diagrams were kept as the programming notation so plant electricians could read the new controllers, which is why ladder logic still looks like a wiring schematic today.
The IEC 61131-3 PLC Programming Languages
The IEC 61131-3 international standard defines the languages most modern PLCs use:
- Ladder Diagram (LD) — graphical relay-style rungs; still the most widely used language for discrete machine control.
- Structured Text (ST) — text-based and Pascal-like; best for math, data handling and loops.
- Function Block Diagram (FBD) — graphical blocks wired together; popular for analog and PID control.
- Sequential Function Chart (SFC) — steps and transitions for organizing sequential processes.
- Instruction List (IL) — a low-level, assembly-like language. It was deprecated in the 2013 edition and removed from the fourth edition published in 2025, although you will still find it in legacy programs.
Most real-world programs mix at least two: ladder for interlocks and sequencing, Structured Text for calculations. See PLC Structured Text, ladder logic vs function block diagram and SFC-style state machines for each language in depth.
A Simple PLC Program Example
Here is the canonical motor start/stop logic in IEC 61131-3 Structured Text:
(* Motor start/stop with seal-in *)
IF StartButton AND NOT StopButton AND NOT Overload THEN
MotorRun := TRUE;
END_IF;
IF StopButton OR Overload THEN
MotorRun := FALSE;
END_IF;
And the equivalent logic expressed as ladder pseudocode:
|--[StartButton]--+--[/StopButton]--[/Overload]--( MotorRun )--|
|
|--[MotorRun]-----+
The second branch — MotorRun in parallel with StartButton — is a seal-in. Once the motor starts, its own output bit keeps the rung true after the Start button is released, until Stop or the overload opens the path. In this teaching example StopButton is true while Stop is pressed; on real panels Stop buttons are usually wired normally closed so a broken wire also stops the motor, and the rung then examines the healthy input as closed. Read more in Seal-In Rungs in Ladder Logic: The Complete Guide.
Run a first rung yourself: the guided first program lets you build a one-contact, one-coil rung, flip the input and watch the output energize in your browser, with no account or install.
Key PLC Vocabulary
| Term | Meaning |
|---|---|
| Coil | An output instruction that turns a bit on or off |
| Contact | An input condition checked in a rung |
| Rung | One horizontal row in a ladder diagram |
| Tag / variable | A named memory location (e.g., MotorRun) |
| I/O module | The hardware card that interfaces with field devices |
| Function block | A reusable instruction with its own memory (timer, counter, PID) |
| Scan time | The duration of one complete read–execute–write cycle |
Vendor Dialects vs the IEC Standard
While IEC 61131-3 is the standard, each major vendor extends and customizes it:
- Allen-Bradley (Rockwell Automation), widely used in North American plants, programs ControlLogix and CompactLogix controllers in Studio 5000 with tag-based addressing and its own instruction mnemonics.
- Siemens uses its own naming conventions in TIA Portal (S7-1200, S7-1500); its SCL language follows IEC Structured Text closely.
- CODESYS and OpenPLC offer close IEC 61131-3 implementations and are popular in education.
If you are learning from scratch, start with generic IEC 61131-3 concepts — the fundamentals transfer to every vendor. Then read PLC Dialects Compared: IEC 61131-3 vs Allen-Bradley vs Siemens to understand the differences before specializing.
How to Learn PLC Programming Without Hardware
Physical PLCs cost hundreds to thousands of dollars and require wiring, panel space and software licenses. Browser-based simulators remove those barriers for the logic half of the skill. You write real ladder logic, run it against a simulated machine model and get immediate pass/fail feedback — the feedback loop you need to build fluency.
Start with the step-by-step PLC programming guide, then take on the Traffic Light scenario, the traditional first project: three outputs (red, amber, green), timed transitions and no sensors to confuse the picture. From there, work through motor start/stop and up to PID loops. Wiring, electrical safety and commissioning still need supervised time on real hardware.
Frequently Asked Questions
What does PLC stand for? PLC stands for programmable logic controller. "PLC controller" is redundant but common; it means the same thing.
Is a PLC a computer? Yes — a specialized one. It has a processor, memory and firmware, but it is built to run one control program in a repeating, predictable scan and to survive an industrial panel.
What language is used to program a PLC? Most PLCs use the IEC 61131-3 languages, especially ladder logic and Structured Text, often with vendor-specific instruction names. Ladder logic is the usual first language.
Are PLCs still used? Yes. PLCs remain the standard controller for discrete machines and many process systems. Newer platforms add Ethernet networking, web diagnostics and more memory, but the scan-based model is the same.
Practice this yourself in the simulator. No install and no credit card. Build and run your first ladder rung in the browser.
