06Level 2
Tank filling with level switches
A pump keeps the level between two switches: it starts at low level and stops at high level (hysteresis control).
Open in the simulator
The simulator is designed for computers (screens 1024 px or wider).
Virtual plant
Level: 10 %. Pump: stopped. Low switch: uncovered. High switch: uncovered. Consumer: open
Shown at rest. In the simulator the plant moves according to your program's outputs.
Inputs and outputs
| Address | Name | Description |
|---|---|---|
| I0.0 | SYSTEM | System on/off switch |
| I0.2 | LEVEL_LOW | Low level switch: 1 when covered by water (≥ 20 %) |
| I0.3 | LEVEL_HIGH | High level switch: 1 when covered by water (≥ 80 %) |
| Q0.0 | PUMP | Filling pump |
Program
Ladder diagram (LD)
Rung 1 — The pump starts at low level and keeps running until high level.
Function block diagram (FBD)
Network 1 — The pump starts at low level and keeps running until high level.
Structured text (ST)
(* Tank filling with level switches — converted from Ladder *)
(* Rung 1: The pump starts at low level and keeps running until high level. *)
PUMP := (SYSTEM AND NOT LEVEL_LOW OR SYSTEM AND PUMP) AND NOT LEVEL_HIGH;Instruction list (IL)
(* Tank filling with level switches — converted from Ladder *)
(* Rung 1: The pump starts at low level and keeps running until high level. *)
LD SYSTEM
ANDN LEVEL_LOW
OR( SYSTEM
AND PUMP
)
ANDN LEVEL_HIGH
ST PUMP
Step by step
- 1Press ▶ Run (F5) and turn on the SYSTEM switch (I0.0). The tank starts almost empty, so the pump starts.
- 2As the level rises, the low switch gets covered but the pump keeps running: the PUMP contact branch keeps it on (seal-in).
- 3At 80 % the high switch turns on and its NC contact stops the pump. The consumer lowers the level until the low switch is uncovered and the cycle repeats.
- 4In the “Virtual plant” tab you can turn the consumer off and see what happens. Raise the speed to ×4 to watch several cycles quickly.