PLC Sim Lab
PLC basics

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.

3 min read · Updated 2026-10-02

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.

The parts of a PLC

PartWhat it does
Power supplyUsually 24 V DC (some PLCs run from 100–240 V AC). Feeds the CPU and often the sensors.
CPURuns the program, stores data (memory bits, timers, counters, data registers) and talks to other devices.
Input moduleReads 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 moduleSwitches loads: contactor coils, solenoid valves, lamps, buzzers. Outputs are relay, transistor (sourcing or sinking) or triac types.
CommunicationEthernet, 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:

  1. Read inputs. The CPU copies the state of every input terminal into memory (the input image).
  2. Run the program. It solves the ladder logic rung by rung, top to bottom, left to right, using that copy.
  3. Write outputs. It copies the results (the output image) to the output terminals in one go.
  4. 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 →