Loading local progress…
Course
Practise in
Level 1, 0 XP · your progress
← Course
Stage 1 · Read, decide, command · 6 min

Think in scans

I can explain a scan and make an output follow an input.

Practise it now: Your first command Free, no sign-up. New to this? Read the lesson first.

1. Why it matters

A pump must notice when the operator lets go of Start, not only when they press it. If it misses that, it keeps pumping when nobody wants it to.

2. The idea in plain words

A (programmable logic controller) is an industrial computer. It reads signals from buttons and , runs your programme, and sends commands to equipment.

It does this again and again, in a loop called a . Each scan copies the , runs your programme, then moves the simulated equipment. Drawing the 3D scene happens separately.

In this academy one scan takes 20 milliseconds, so 50 scans fit into one second.

Example: on one scan the PLC sees Start pressed and turns the pump on. On the next scan it sees Start released and turns the pump off.

Take the line #PumpOn := #Start; It copies Start into the pump command on every scan. Start means run; means stop.

A value with only these two choices has the type , short for Boolean.

The toolbar controls the scans. Run repeats them by itself. Step scan runs exactly one. Pause freezes the whole simulation.

Pause is not the same as the Stop button on the equipment. Stop is an input: a signal your programme reads. It only stops the pump if your code says so.

3. See it happen

Siemens SCL · TIA Portal V20
#PumpOn := #Start;

Start was TRUE on the last scan and is FALSE now. What does this scan do?

Decide your answer first. Then step through the scans to check it.

Input or eventResult
Scan 1: Start = FALSE?
Scan 2: Start = TRUE?
Later: Start = FALSE?

A mistake to look for

Mistaking movement for the command. Compare three signals: the command, the real speed (rpm) and the measured flow. They are linked, but they are not the same.

4. Vendor notes

Siemens notes

In SCL, # marks a tag that belongs to this block: a local tag. := writes a value, and a semicolon ends each instruction.

This training task runs every 20 ms.

5. On site

In a factory wash room, an operator holds a button to run a water pump. Letting go should stop the pump.

If the pump keeps running after the button is released, the hose keeps spraying when nobody expects it.

Where you'd find thisWater for the top floors

In a block of flats, a basement tank holds water from the mains. Two pumps push it up to the taps above. One runs while the other waits as a spare. A low-water switch stops the pumps before the tank runs dry.

  1. Street mainsWater enters the building
  2. Storage tankHolds a supply for the pumps
  3. Water pumpsPush water to the floors aboveYou are here
  4. Taps upstairsResidents use the water they need
On a real site: places, parts and safety
  • Block of flats — pushing water up to the top floors
  • Brewery — sending hot water to a brewing tank
  • Water-treatment works — moving water between filter tanks
  • Office building — pumping water round the heating pipes

Recognise it on site

  • The reservoir stores the water. On this practice rig the water flows back into it, so normal pumping never empties it.
  • An electric motor spins the pump to push water through the pipe. A guard covers its moving shaft.
  • The standby pump is a spare on the same pipes. It takes over when the main pump cannot run.
  • The flow transmitter, a meter in the pipe, measures how much water passes each second.
  • The pressure gauge shows how hard the water pushes against the pipe walls.
  • The controller cabinet holds the PLC, the industrial computer that runs your code. It also holds the switches that power the motors.

A low-water switch can take away permission to run. The pump must stop before it runs dry and damages its seal.

The PLC can say ON even when a pump has failed. Check the measured flow as well as the command.

The Stop input in these exercises is not an emergency stop. Real machines also need guards, emergency stops and a safe way to cut the power.

The sizes, timings and cutaways are teaching choices, not a drawing of any one real installation.

6. Try it on the rig

With the simulation paused, switch Start on in the Inputs tab, then press Step scan. Switch Start off and press Step scan again. Then press Run. Press and hold the Start button below the model, then let go.

Open the mission, make a prediction, run the equipment, then test your programme. Passing the tests completes practice; reading this page alone does not.

01. Your first command

7. Check your understanding

Predict a new case. A wrong answer gives you an explanation and another try.

1. Nobody is pressing the Start button, so Start is FALSE. The PLC runs this line. What does it set PumpOn to?

Siemens SCL
#PumpOn := #Start;
Choose your answer

2. Which type holds a simple yes/no value: TRUE or FALSE?

Choose your answer