PLC Simulator
PLC field notesfundamentals

Programmable Logic Controller (PLC): What Is a PLC?

A programmable logic controller (PLC) is a rugged industrial computer that reads inputs, runs a control program and switches outputs. Learn how PLCs work.

PLC Simulation Software12 min read

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.

PLC system architecture showing field sensors feeding input modules, the CPU running the program, and output modules driving motors, valves and lights

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:

Reference tableSwipe
ComponentWhat it does
Power supplyConverts 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
MemoryStores the program, tag values, timer and counter states, and retained data
Input modulesConvert field signals — pushbuttons, limit switches, sensors, 4–20 mA transmitters — into data the CPU can read
Output modulesDrive contactors, solenoid valves, lamps and analog setpoints through relay, transistor or analog outputs
Communication portsConnect to HMIs, SCADA, drives, remote I/O and other controllers over networks such as EtherNet/IP, PROFINET or Modbus
Programming softwareRuns on a PC to write, download, monitor and troubleshoot the program

Anatomy of a PLC showing the CPU connected to memory, I/O modules, communications ports and the power supply

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:

  1. Read inputs — the processor samples every input and stores the values in an input image table in memory.
  2. 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.
  3. Write outputs — the processor copies the output image table to the physical output terminals, energizing or de-energizing each wired device.
  4. Housekeeping — the CPU handles communications and self-diagnostics, and a watchdog timer faults the controller if a scan takes too long.

Flowchart of the PLC scan cycle: read inputs, execute the control program, write outputs, then repeat

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.

Timing diagram of PLC cyclic scanning showing inputs sampled at the start of each scan and outputs updated at the end

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.

Reference tableSwipe
LogicLadder logic formStructured Text formPlain-English example
ANDContacts in seriesRun := Guard AND Start;Run only if the guard is closed AND Start is pressed
ORContacts in parallelLamp := Button1 OR Button2;Either button turns the lamp on
NOTNormally closed contactOk := NOT Fault;Healthy while there is no fault
Memory (latch)Seal-in branch or SET/RESET coilIF Start THEN Run := TRUE; END_IF;Keep running after Start is released
TimeTON / TOF timer blockDelay(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.

Checklist of industries and applications where PLCs are used, from conveyors and water treatment to packaging and process control

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:

Reference tableSwipe
PLCHardwired relay logicMicrocontroller boardRegular PC
How logic changesEdit and download the programRewire relays and timersRewrite and reflash firmwareChange the application
Industrial I/OPlug-in modules for 24 VDC, 120 VAC, 4–20 mARelay coils and contactsYou design the protection and interface circuitsNeeds add-on I/O hardware
TimingDeterministic, repeating scan with a watchdogFixed by wiring; each relay takes milliseconds to switchDeterministic if written carefullyGeneral-purpose OS scheduling
EnvironmentBuilt for panel temperature, vibration and electrical noiseIndustrial panelsDepends on your board and enclosureOffice-grade unless it is an industrial PC
MaintenanceOnline monitoring and diagnostics that technicians can readTrace wires with a meterNeeds the original developer's toolsIT-style support
Best fitMachines and processes that change and must be maintained for yearsVery small, fixed circuits and hardwired safetyHigh-volume products where the logic rarely changesData, visualization and supervisory software

Comparison table of a PLC versus a regular PC across scan timing, environment, I/O, startup time and service life

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.

Comparison of a PLC versus a hardwired relay panel, listing the advantages of a programmable controller

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.

Checklist of the IEC 61131-3 PLC programming languages: ladder diagram, structured text, function block diagram, instruction list and sequential function chart

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]-----+

PLC ladder logic example of a motor start/stop seal-in rung with a Start contact, normally closed Stop contact and a MotorRun coil

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

Reference tableSwipe
TermMeaning
CoilAn output instruction that turns a bit on or off
ContactAn input condition checked in a rung
RungOne horizontal row in a ladder diagram
Tag / variableA named memory location (e.g., MotorRun)
I/O moduleThe hardware card that interfaces with field devices
Function blockA reusable instruction with its own memory (timer, counter, PID)
Scan timeThe 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.

Build your first rung free →

ShareX / TwitterLinkedIn

From reading to running logic

Practice this yourself in the simulator

Start with guided PLC practice in your browser. No install and no credit card required.

Start practising free

Continue learning

Related field notes

All articles
fundamentals
scan cycle

The PLC Scan Cycle Explained (With Diagrams)

The PLC scan cycle is the continuous read-execute-write loop at the heart of every controller. Learn what happens in each phase and why scan time matters for your control programs.

8 min read
ladder logic
fundamentals

Seal-In Rungs in Ladder Logic: The Complete Guide

A seal-in rung keeps a coil latched after the momentary start signal drops. Learn how to build reliable seal-in circuits with stop, overload, and E-stop protection.

8 min read
ladder logic
structured text

Ladder Logic vs Structured Text: Which One to Learn First

Ladder logic is graphical and widely supported; structured text is textual and powerful for maths. Compare syntax, use cases, and job market demand to choose your first PLC language.

9 min read

Technical reference and worked-example guide

What is a PLC technical guide: field reference

Direct answer

The reader can explain how a physical input becomes program state and an output request, and why independent feedback is required to prove the machine result.

Written for beginners, technicians and engineering students who want a practical definition connected to observable control behavior.

a PLC logic and scan-cycle training station with observable inputs, outputs, timing traces and program state used to prove execution behavior while studying PLC hardware, cyclic execution, I/O, program state, communications and machine feedback
System map / 02

NODE 01observable

Definition

Controller purpose, power and processor, input and output modules, process image, cyclic task, program instructions, memory, communications, diagnostics and feedback.

NODE 02observable

Signal path

Field condition through sensor and input channel to sampled data, program evaluation, output channel, interface, actuator and returned status.

NODE 03observable

Worked example

A simple start-stop requirement produces predictable input, program, output and physical or modeled response across repeated scans.

NODE 04observable

Limits

Simultaneous commands, input bounce, timer boundary, output overwrite, communication loss, retained state, controller restart and feedback failure.

NODE 05observable

Common mistake

A field, wiring, input, mapping, scan, logic, output, interface, actuator or feedback mismatch.

NODE 06observable

Verification

The example recreated in the official engineering environment and proven on intended supervised hardware.

Answer surface / 07

What is a PLC?

A programmable logic controller is an industrial computer designed to read inputs, execute deterministic control logic, update outputs and provide diagnostics and communications for machines and processes.

How is a PLC different from a normal computer?

PLCs emphasize industrial I/O, cyclic or scheduled control, environmental robustness, maintainability and predictable operation, although exact architectures vary.