What is a PLC

A PLC (Programmable Logic Controller) is an industrial computer designed to control machines and processes. It reads signals from sensors, runs a program and drives motors, valves, cylinders or drives. And it does so repeatedly and predictably, for years.

Where a PC is optimised to do many things at once, a PLC is optimised to do one thing very well: run its program over and over with guaranteed timing, in environments with dust, vibration, extreme temperatures and electrical noise.

If a machine moves on its own and has an electrical cabinet, there is almost certainly a PLC inside.

From relays to software: a little history

Before the PLC, machine logic was built from relays wired into huge cabinets. Changing a sequence meant rewiring: expensive, slow and error-prone.

In 1968 General Motors’ Hydra-Matic division asked for an electronic controller that could replace those relay cabinets and be reprogrammed. The best-known answer was the Modicon 084, developed by Dick Morley’s team and regarded as the first PLC.

  • 1970s: first PLCs; ladder logic imitates relay diagrams so electricians can read it.
  • 1980s and 1990s: fieldbuses (PROFIBUS, DeviceNet) and operator panels.
  • 2000s: industrial Ethernet (PROFINET, EtherNet/IP) and safety PLCs.
  • Today: OPC UA, connection to business systems, simulation and virtual commissioning before reaching the plant.

What is inside a PLC

  • CPU: runs the program in cycles and handles diagnostics.
  • Memory: stores the program, configuration and data that must survive a power cut.
  • Inputs: receive signals from sensors, limit switches, temperature probes, pressure switches or encoders.
  • Outputs: drive contactors, solenoid valves, drives or indicators.
  • Communications: PROFINET, EtherNet/IP, Modbus or OPC UA to talk to panels, robots, SCADA and other PLCs.

The scan cycle: why a PLC is predictable

What defines a PLC is its scan cycle, a sequence that repeats endlessly:

  1. Read inputs: the PLC takes a "snapshot" of every signal.
  2. Execute the program: it solves the logic using that snapshot.
  3. Write outputs: it updates the actuators.
  4. System tasks: communications and self-diagnostics.

Depending on the CPU and program size, a cycle lasts from a few milliseconds to a few tens of milliseconds. If a cycle runs longer than allowed, a watchdog timer puts the PLC into a safe state. That predictability is what makes it trustworthy enough to control a machine.

Programming languages (IEC 61131-3)

The IEC 61131-3 standard defines the PLC programming languages. Each vendor adapts them to its environment (in Siemens TIA Portal they are called LAD, FBD, SCL and GRAPH):

  • LD (Ladder Diagram): graphical, imitates relay diagrams. Ideal for simple logic and easy for maintenance to read.
  • FBD (Function Block Diagram): blocks connected by lines. Widely used in process control and analogue signals.
  • ST (Structured Text): Pascal-like. The most convenient for calculations, loops and data handling.
  • SFC (Sequential Function Chart): steps and transitions. Perfect for long sequences and batch processes.
  • IL (Instruction List): low level, deprecated in the 2013 edition of the standard.

A good program does not use a language out of habit: it picks the one that makes the code clearest for whoever will maintain it.

Safety PLCs: what changes

A safety PLC (F-CPU at Siemens, GuardLogix at Rockwell) is designed and certified by an independent body to run safety functions: emergency stops, light curtains, access doors. Internally it uses redundancy and self-diagnostics, and its safety program is kept separate from the standard program and identified by a signature, so any change is detected.

The safety level each function needs (PL under EN ISO 13849-1, SIL under IEC 62061) is set by the machine’s risk assessment. A safety PLC is not always required: simple functions can be handled with safety relays or configurable modules such as PNOZmulti.

How to choose a PLC for a project

The brand is the last question. Others come first:

  1. Inputs and outputs: how many, what type (digital, analogue, high-speed) and with spare capacity.
  2. Performance: required cycle time, motion control, number of axes.
  3. Communications: which robots, drives, SCADA or business systems need connecting.
  4. Safety: which safety functions exist and what level they require.
  5. Maintenance: which platform the plant team knows and what is already installed.
  6. Total cost: licences, training, spares and support over the machine’s lifetime.

If the choice is between the two most widespread platforms in Spain, we cover it in Siemens vs Rockwell: how to choose a PLC for your project.

The PLC in Industry 4.0

With cloud, edge and artificial intelligence, people often ask whether the PLC has a future. It does, because none of those layers guarantees what it guarantees: deterministic timing, safety functions and robustness on the shop floor.

What changes is its role. The PLC is no longer an island: it sends reliable data upwards (OPC UA, MQTT) and receives recipes and orders from business systems. How to organise that connection without creating a tangle is explained in ISA-95: how to connect the PLC to the ERP.

Dashboards and analytics live higher up. But if the PLC does not do its job well down below, what you see up there cannot be trusted.

Frequently asked questions

How much does a PLC cost?

From a few hundred euros for an entry-level compact CPU to several thousand for a high-end CPU with integrated safety. In a project, the PLC is usually a small part of the total cost: most of it goes into engineering, programming, field devices, the cabinet and commissioning.

Can a PLC be attacked?

Yes. Stuxnet (2010) showed that a PLC can be the target of a deliberate attack. The IEC 62443 series sets out good practice for industrial cybersecurity: network segmentation, access control, user management and monitoring. European regulation (NIS2, the Cyber Resilience Act) is raising requirements in this area.

Can an Arduino or Raspberry Pi replace a PLC?

For prototypes, training or non-critical applications, they can work. For a production machine, a PLC brings industrial robustness, long-term support, spares and technicians who know how to maintain it; and safety functions require equipment certified for that purpose.

How long does it take to learn PLC programming?

The fundamentals (logic, scan cycle, IEC 61131-3) take weeks and are common to all brands. Becoming fluent in an environment such as TIA Portal or Studio 5000 takes months of real work, and mastering complex projects takes years.

What PLC documentation should come with a machine?

At a minimum: electrical drawings, the commented program and its backup, tag and alarm lists, network configuration and any passwords or licences needed. Without them, the plant depends forever on whoever wrote the program.