Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

How an industrial plant is controlled

After this lesson: I can trace how a PLC turns a sensor reading into a pump command.

60 min lesson2 commandsIndustrial control system security lab: a simulated PLC, Modbus, HMI and conduit

The computer that keeps a tank from overflowing

An industrial control system is the set of computers, sensors and pumps that runs a plant, such as a water works or a factory. When it fails, water stops, or a tank overflows.

This module teaches how these systems work and how they are defended. Everything happens in your own simulated lab, never on a real plant.

By the end of this lesson

Note

I can trace how a PLC turns a sensor reading into a pump command.

Key words

WordWhat it meansExample
Sensora device that measures somethinga level sensor
Actuatora device that acts on the planta pump
PLCa programmable logic controller, the computer that runs a machine
Scan cycleread inputs, run the logic, write outputs, then again
HMIthe human-machine interface, the operator's screen
Purdue modela map of a plant's computers in levels, from the floor up

The cells students fill in are left blank in this preview.

The one rule

Warning

Work only in your own lab copy, and only with permission. Never send a command, a scan or a probe to a real plant or a device that is not yours. In the UK that can be a crime under the Computer Misuse Act 1990, and on a real plant it can hurt people.

Sensors, a PLC and actuators form a loop

A sensor measures the plant. In the lab, a level sensor reports how full a water tank is, from 0 to 100 per cent.

A PLC reads that number and decides what to do. An actuator carries it out. Here the actuator is a pump that fills the tank, while an outlet always drains it.

The rule in the lab is simple. The pump starts at 20 per cent and stops at 80. Those two numbers are the setpoints.

A PLC works in scans

A PLC does not wait for events. It repeats one scan cycle for ever: read every input, run the logic, write every output.

The lab's PLC scans every 0.1 seconds. A change that happens just after the inputs are read waits for the next scan. So the worst reaction time is two scans.

Work seven scans by hand

Command
docker exec work python3 steps/scancycle.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

Worked example: what the lab printed

ScanLevel readLogic saysLevel after
123pump off22
321pump off20
420pump on21
723pump on24

The cells students fill in are left blank in this preview.

Try it: add up one scan

Code: python
parts = {"read inputs": 2, "run logic": 5, "write outputs": 2, "talk to the HMI": 1}

total = 0
for name in parts:
    total = total + parts[name]
    print(name, parts[name], "ms")
print("scan time:", total, "ms")
print("worst reaction:", 2 * total, "ms")
# Change "run logic" to 45. Does the scan still fit inside 50 ms?

The HMI shows the plant to a person

An operator cannot read a PLC's memory. They watch an HMI, a screen that asks the PLC for its values and draws them.

The lab has one. Open HMI from the bar to see the level, the pump and the mode. It refreshes every second and it only reads.

Read the PLC without changing it

Command
docker exec work python3 steps/plant.py

Shown here, not run. Press Start lab to type it into your own lab’s terminal.

A common mistake

Warning

Many people think the HMI controls the plant. The PLC does. The HMI only shows what the PLC reports and passes on what an operator asks. If the HMI stops, the PLC keeps running the tank. So protecting the HMI alone does not protect the plant.

The Purdue model: a level per computer

LevelWhat lives thereIn the lab
0Sensors and actuatorsThe level sensor and the pump
1Controllers such as PLCsplc
2Supervisory screens such as HMIshmi
3Site operations, historians, engineeringwork
4 and 5The business network and the internetNot in the lab

The cells students fill in are left blank in this preview.

Levels become zones with doors between them

The levels are not only a map. Each level is a zone, a group of machines trusted the same.

Traffic between zones should pass through a controlled door, called a conduit. The lab has one, the gateway, which you meet in lesson 5. The network security module taught zones for offices, and the idea is the same.

About this lab and its source: Industrial control system security lab: a simulated PLC, Modbus, HMI and conduit

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.