The short answer
The PLC Processor
The processor, or CPU, holds the control program and the data table, solves the program against the current input image on every scan, and manages the backplane, communications, and diagnostics. Its mode switch decides whether it is running or being programmed, its status lights are the first diagnostic in the field, and when something goes wrong it faults in a defined way that leaves outputs in a known state rather than continuing with bad data.
Key points
- The processor solves logic against a snapshot of inputs taken at the start of the scan, not against live signals.
- Program memory and data memory are separate; retentive data survives a power cycle only if the hardware provides for it.
- Run, program, and remote modes decide what can be changed and from where, and the keyswitch position is part of the security of the system.
- Status lights and the fault log are the first diagnostic; read them before connecting a laptop.
- A fault is a designed response: outputs go to their configured state and the fault code says why.
What the processor does
Every scan the processor performs the same sequence: it copies the state of the input modules into the input image, solves the program top to bottom against that image, writes the resulting output image to the output modules, and then services communications and housekeeping. The scan cycle page covers the order and its consequences in detail. The processor is also the module that talks to the programming software, to SCADA, and to other controllers, and it runs the diagnostics that decide whether the system is healthy.
Processing speed matters less than most people expect. Scan time is dominated by the size of the program and the volume of I/O and communication, and a controller that scans in ten milliseconds is not noticeably better than one that scans in twenty for a pump station. Determinism matters more: the scan must complete within a bounded time, every time, and the watchdog enforces it.
Memory
- Program memory
- Holds the logic, the routines, and the configuration. Sized in kilobytes or megabytes depending on the platform, and a full program memory stops further downloads.
- Data memory
- Holds the data table: input and output images, timers, counters, integers, floats, strings, and the user-defined structures. This is what the program reads and writes and what SCADA reads.
- Retentive memory
- The portion of data memory that survives a power cycle, backed by a battery, a capacitor, or nonvolatile storage. Setpoints, totalizers, and run hours live here. What is retentive and how it is protected is a platform property covered on the retentive memory page.
- Nonvolatile program storage
- A memory card or internal flash that holds a copy of the program so that a controller that has lost its memory can restore itself on power-up. Whether it loads automatically, and whether it overwrites recent online edits, is a setting worth knowing.
Modes
The processor is always in one of a few modes, selected by a keyswitch on the module, by the programming software, or both. The names differ by vendor, but the behaviors are the same everywhere.
| Mode | Logic | Outputs | Downloads and edits |
|---|---|---|---|
| Run | Executing | Controlled by the program | Not permitted, or online edits only, depending on the keyswitch |
| Program | Stopped | Off or at their configured state | Permitted |
| Remote | As selected by software | As selected | The software can change the mode; the key is not needed at the panel |
| Test | Executing | Held off; the program runs but outputs are not written | Used to check logic without moving equipment |
Status lights
The lights on the front of the processor are the diagnostic that needs no software. Their exact set varies, but a technician arriving at a faulted panel should be able to read them before opening a laptop.
- Run
- Solid when the processor is executing logic. Off in program mode. Flashing usually means the processor is in run but a condition, such as a missing program, is preventing execution.
- OK, or fault
- Solid green when healthy. Flashing red usually means a recoverable fault; solid red an unrecoverable one. The manual for the platform gives the exact meanings.
- I/O
- Solid when every configured module and remote connection is present and healthy. Flashing when one or more is missing or faulted, which is the usual first sign of a remote rack losing its network.
- Communication ports
- Activity and link lights on the Ethernet and serial ports. A dark link light on a port that should be connected is a cable or switch problem, not a program problem.
- Battery or energy storage
- Lit when the retention backup is low or absent. It is the light that gets ignored until the day the power goes out and the setpoints go with it.
Faults
When the processor detects a condition it cannot safely continue through, it faults: it stops executing logic, drives outputs to their configured fault state, lights the fault indicator, and records a fault code with the routine and instruction where it happened. Faults are classified as recoverable, which can be cleared and the processor restarted, and unrecoverable, which need a power cycle or a download.
- Watchdog timeout, when a scan runs longer than the configured limit, usually from a loop in logic or a communication task that stalls.
- Program faults such as an array index out of range, a divide by zero on some platforms, or a jump to a missing label.
- I/O faults, when a configured module is missing, is the wrong type, or a remote connection has failed and the connection is set to fault the processor.
- Memory faults, from a failed battery, corrupted program storage, or a firmware mismatch after a module replacement.
- Power faults, from a brownout that dropped the backplane below its minimum, which can look like a random restart.
Firmware and replacement
The processor runs firmware, and the programming software, the project file, and the firmware have to be compatible with each other. A replacement processor from stock often carries a different firmware revision than the one it replaces, and the project will not download until they match. Recording the firmware revision on the rack drawing and keeping the matching software installed is what turns a processor replacement from a day into an hour.
Frequently asked questions
- What is the difference between program mode and run mode?
- In run mode the processor executes the program and controls outputs. In program mode it stops executing, outputs go off or to their configured state, and the program can be downloaded or changed. Remote mode lets the software choose between the two without the key.
- Why does a faster processor not give a faster scan?
- Because scan time is mostly the program size, the I/O count, and the communication load, not the clock speed of the processor. Halving the program does more for scan time than doubling the processor speed.
- What does a flashing fault light mean?
- On most platforms a flashing red fault light is a recoverable fault: the processor has stopped, a fault code is recorded, and the fault can be cleared from the software or the keyswitch once the cause is fixed. Solid red is usually unrecoverable and needs a power cycle or a download. Read the platform manual for the exact pattern.
- Should the processor be left in remote mode?
- Not after commissioning. Remote mode lets anyone with network access change the mode or download. Leave it in run, remove the key, and use remote mode only during work that needs it.
Related topics
- The PLC Scan CycleRead inputs, solve logic, write outputs, housekeeping. Understanding scan order explains most PLC behavior that looks wrong at first glance.
- PLC ArchitectureHow a programmable logic controller is physically organized: the chassis, backplane, processor, I/O modules, remote racks, and what those choices mean for wiring, expansion, and failure.
- Retentive MemoryWhat survives a power cycle in a controller and what does not, how retention is backed up by battery, capacitor, or nonvolatile storage, what should be retentive, and how retained data gets lost.
- The Watchdog TimerWhat the scan watchdog protects against, why it faults the controller instead of pausing it, what makes a scan run long, and why raising the limit is the wrong first response.
- Processor FaultedA PLC with its fault light on and no logic running. How to read what it is telling you, the causes in order of likelihood, and how to restart it without repeating the fault.
- What Is a PLC?A programmable logic controller is a ruggedized industrial computer that reads field inputs, solves a control program, and drives outputs on a repeating, deterministic cycle.
Direct contact
Have a controls question?
Reach Eric Sullivan directly about anything on this site, a controls or automation topic, or one of his personal projects.