What Is a PLC? Programmable Logic Controllers Explained with a Worked Example

On this page

A programmable logic controller (PLC) is an industrial computer that controls machines and processes. It reads inputs from sensors, switches and push buttons, runs a program written by an engineer, and switches outputs such as motor starters, valves, lamps and drives. It repeats this cycle continuously, typically every few milliseconds, and is built to keep doing so for years in dust, heat, vibration and electrical noise.

What a PLC Does: Inputs, PLC program, Outputs, HMI & networks
A PLC reads inputs, runs its program and drives outputs.

The international standard for PLCs is IEC 61131. Part 3 of it defines the programming languages that most PLCs use today. See PLC Programming Languages.

Inputs, program, outputs

Part Examples What the PLC does with it
Digital inputs Push buttons, limit switches, proximity sensors, photo-eyes, motor running contacts Reads on/off states
Analog inputs 4–20 mA or 0–10 V from pressure, level, temperature and flow transmitters Converts to numbers and scales to engineering units
Program Ladder logic, function blocks, structured text, sequential function charts Decides what the outputs should be
Digital outputs Motor contactors, solenoid valves, lamps, horns Switches them on or off
Analog outputs Speed reference to a drive, position to a control valve Sends a proportional signal
Communication HMI panels, drives, robots, SCADA, other PLCs Exchanges data over industrial networks

The PLC reads all inputs, runs the program, then writes all outputs, and repeats. This is the scan cycle; see How PLCs Work.

A worked example: starting a conveyor

A conveyor motor must start when the operator presses START, keep running after the button is released, and stop when STOP is pressed or the motor overload trips. The inputs and outputs (illustrative addresses):

Signal Type Tag
Start push button (normally open) Input Start_PB
Stop push button (normally closed) Input Stop_PB
Motor overload contact (normally closed) Input OL_OK
Motor contactor Output Conveyor_Run

In ladder logic, this is the classic start/stop “seal-in” circuit:

|  Start_PB      Stop_PB     OL_OK          Conveyor_Run |
|----] [----+----] [--------] [-------------------( )----|
|           |                                            |
|  Conveyor_Run                                          |
|----] [----+                                            |

The same logic in structured text:

Conveyor_Run := (Start_PB OR Conveyor_Run) AND Stop_PB AND OL_OK;

Two design points show why PLC programs are written this way:

  • The stop button and overload are normally closed contacts, so a broken wire stops the motor instead of preventing a stop. This is fail-safe wiring.
  • The seal-in contact (Conveyor_Run in parallel with START) keeps the motor running after START is released.

An emergency stop must not rely on this logic alone: it is implemented with safety-rated devices or a safety PLC according to machine safety standards. See PLC Industry Standards.

Start/Stop Seal-In Logic for a Conveyor (Illustrative): Start_PB, Seal-in, Stop_PB & OL_OK, Conveyor_Run
The classic seal-in circuit, with fail-safe normally closed stop contacts.

The parts of a PLC system

Part Role Detail page
CPU Runs the program and communication PLC Components
I/O modules Connect field signals PLC Components
Power supply Usually 24 V DC for the PLC and I/O PLC Components
Programming software Writing, downloading and testing programs PLC Programming Software
HMI Operator screens and controls SCADA HMI Display Design
Networks PROFINET, EtherNet/IP, Modbus TCP, OPC UA Industrial Communication Protocols

PLCs come as compact units with built-in I/O, modular systems with separate modules, and larger rack-based or high-availability systems. See Types of PLCs.

PLC compared with other control options

Option Strengths Typical use
Relay logic Simple, easy to understand for small circuits Very small or safety-related hard-wired circuits
PLC Rugged, deterministic, easy to change, strong diagnostics Machines, lines, skids, pump stations
Industrial PC Computing power, data handling, vision Complex applications, often alongside a PLC
DCS Integrated plant-wide process control Refineries, chemical and power plants; see DCS vs PLC
SCADA Supervision of many remote sites Uses PLCs and RTUs at each site; see What Is SCADA?

For why PLCs replaced relay panels and their limitations, see Why PLCs Matter.

PLC, DCS and SCADA: Typical Scope: PLC (Machine, skid or line, Fast discrete logic); DCS (Whole process plant, Integrated database); SCADA (Many remote sites, Supervision over telemetry)
Choose by scope: machine, plant or geographically spread assets.

Where PLCs are used

Key terms

Term Meaning
Scan cycle Read inputs, execute program, write outputs, repeat
Tag A named variable, such as Conveyor_Run
Rung One line of ladder logic
Normally open / normally closed Contact state when not actuated
Seal-in (latch) Logic that keeps an output on after the start signal ends
Download / upload Transferring the program to or from the PLC
Online edit Changing the program while the PLC runs
Force Overriding an input or output for testing; dangerous if left in place

How to start learning

  1. Learn digital and analog I/O and basic electrical wiring.
  2. Practise ladder logic with start/stop, timers and counters, then structured text.
  3. Use a vendor’s free or trial software with its simulator, or an IEC 61131-3 environment such as CODESYS.
  4. Study the scan cycle, troubleshooting and safety basics.

See the Automation Engineer Roadmap and PLC Interview Questions.

Frequently asked questions

What does PLC stand for?

Programmable logic controller: an industrial computer that controls machines and processes by reading inputs, executing a program and switching outputs.

What is the difference between a PLC and a normal computer?

A PLC is built for the plant floor: it tolerates harsh conditions, executes its program deterministically in a fixed cycle, connects directly to industrial I/O and runs for years without an operating system that needs frequent updates. A normal computer is general purpose.

Which PLC programming language should I learn first?

Ladder logic is still the most common for machine control and maintenance, and structured text is increasingly important for complex logic. Learning both covers most jobs.

Key takeaways

  • A PLC reads inputs, runs a program and writes outputs in a continuous scan cycle.
  • Programs are written in IEC 61131-3 languages such as ladder logic and structured text.
  • Fail-safe wiring (normally closed stops) and separate safety systems are part of good design.
  • PLCs control machines, lines, utilities and infrastructure; DCS and SCADA serve larger or distributed systems.

Before you apply this in a plant: this article is for education. Always check the current edition of the relevant standards, the manufacturer's documentation for your exact product and version, and your site's procedures. Safety-related work needs qualified personnel. See our editorial policy.

Written by Bhargava Reddy Kapireddy

Bhargava has 16 years of hands-on experience with MES, SCADA, DCS, PLC and industrial data systems across power generation, oil and gas, pharmaceuticals and process manufacturing. He founded MFG Tech Hub to share practical, vendor-neutral automation knowledge.

More about the author → How we write and review articles