Build permission into the logic
I can combine conditions and explain which request wins.
Practise it now: Permission to run Free, no sign-up. New to this? Read the lesson first.
1. Why it matters
A pump that runs with an empty supply tank runs dry and wrecks its seal. So the programme must check the water supply as well as the Start button.
2. The idea in plain words
A is a condition that must be true before equipment may run. In these labs, Permit means all those conditions are met.
You combine conditions with three words. AND needs every condition. OR needs at least one. NOT flips TRUE to , and FALSE to TRUE. Parentheses show which parts go together.
Example: Start AND Permit is TRUE only when both are TRUE. Press Start with no water, and the pump stays off.
You can compare numbers too. Level < 30 checks a measured level against a limit, and gives TRUE or FALSE.
Watch the symbols: := writes a value, while = checks if two values are equal. and hold whole numbers; keeps the decimals.
What if Start and Stop are both pressed? Stop should win. You must write that into the logic. Do not rely on which button was pressed first.
To test it, open the tab and switch both Start and Stop on. These switches stay on until you switch them off.
You can also write decisions with IF. IF condition THEN runs its lines only when the condition is TRUE. ELSE covers the other case. END_IF closes the block.
ELSIF checks another condition, but only if the branch before it did not run. A line that does not run leaves its unchanged.
You can also skip IF and assign a whole TRUE/FALSE expression in one line.
On site, these checks are process . They are not a safety system, such as an emergency-stop circuit.
3. See it happen
#PumpOn := #Start AND #Permit
AND NOT #Stop AND NOT #Fault;What wins when Start and Stop are both TRUE?
Decide your answer first. Then step through the scans to check it.
| Input or event | Result |
|---|---|
| Start TRUE, Permit TRUE, Stop/Fault FALSE | ? |
| Permit disappears | ? |
| Start and Stop both TRUE | ? |
A mistake to look for
Checking permission only at the moment of starting. Check it on every scan, so losing it stops a running pump. This programme has no hold memory yet, on purpose.
4. Vendor notes
Siemens notes
AND, OR and NOT combine BOOL values. <, <=, >, >=, = and <> compare numbers; <> means not equal.
:= writes a value; = checks if two values are equal. Parentheses show which parts go together.
5. On site
A brewery pump draws hot water from a storage tank. A low-water switch says whether there is enough to pump.
Running the pump dry can ruin its seal. Losing the water supply must stop it, even after it has started.
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.
- Street mainsWater enters the building
- Storage tankHolds a supply for the pumps
- Water pumpsPush water to the floors aboveYou are here
- 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
Make the pump stay off when Permit is missing, and when Fault is on. Then press Test solution.
Open the mission, make a prediction, run the equipment, then test your programme. Passing the tests completes practice; reading this page alone does not.
02. Permission to run7. Check your understanding
Predict a new case. A wrong answer gives you an explanation and another try.
1. Start and Stop are both TRUE; Permit is TRUE. What is PumpOn?
#PumpOn := #Start AND NOT #Stop AND #Permit;