How a PLC works: inputs, program execution and outputs

How a PLC works: inputs, program execution and outputs

How does a PLC control a machine?

A programmable logic controller (PLC) reads signals from a machine, runs a control program and commands outputs. A sensor might report that a part has reached a station; the program checks the machine conditions before it commands the next movement.

3 min readContent reviewed

Many introductory explanations describe this as a repeating scan. That is a useful starting point, although the exact update order and timing depend on the controller and its configured tasks.

How inputs reach the program

Switches, sensors and transmitters connect to input modules. Digital inputs represent states such as a switch being open or closed. Analog inputs represent a measured value, such as pressure or temperature, using the signal type supported by the module.

The controller commonly stores input states in a process image: a set of values that the program can read during execution. This keeps the values consistent while the program evaluates them. Some controllers also allow direct peripheral access or separately timed I/O updates.

What happens when the program runs

The CPU evaluates the instructions using input values, internal data, timers and other program conditions. The result may change an internal state or an output value. A motor command, for example, can depend on an operator request and several interlocks.

Ladder diagram, function block diagram and structured text are ways to write this logic. Programming is a development activity; it is not a separate step that the PLC repeats after every output update.

How the outputs change

The output module applies the commanded state to the connected circuit. The program's output value and the physical actuator are separate parts of that path. A command can be present while a field power supply, output channel or actuator has a fault.

For the S7-1200 process image described in Siemens documentation, the CPU writes the output image to physical outputs, reads physical inputs into the input image, then executes the user program. The program updates the output image for the subsequent transfer. This is why a simplified diagram should not be treated as the timing specification for every PLC.

Diagnostics and communication

A PLC also handles diagnostics and communication with devices such as an HMI. These functions help the operator see machine status and help maintenance staff locate faults. Their scheduling, together with task execution and I/O updates, affects response time.

When diagnosing a delayed or missing action, compare the sensor state, the value seen by the program, the logic conditions and the physical output. Record the controller model and consult its execution and I/O documentation before drawing conclusions from the scan time alone.

Identify the PLC part you need

Send the CPU or module part number, revision and quantity. Add a label photograph and the fault symptoms when requesting a replacement.

Manufacturer references

Technical reference: Siemens: S7-1200 process image.

Need a quote for this part?

Send us the part number or article link — we will confirm price, availability and lead time.

WhatsApp us

Related Articles

Back to blog