Skip to content
PLCampus
All examples

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).

The simulator is designed for computers (screens 1024 px or wider).

Virtual plant

Q0.0 · Pump10 %I0.3 · High switchI0.2 · Low switch

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

AddressNameDescription
I0.0SYSTEMSystem on/off switch
I0.2LEVEL_LOWLow level switch: 1 when covered by water (≥ 20 %)
I0.3LEVEL_HIGHHigh level switch: 1 when covered by water (≥ 80 %)
Q0.0PUMPFilling pump

Program

Ladder diagram (LD)

  1. Rung 1 — The pump starts at low level and keeps running until high level.

    SYSTEMI0.0LEVEL_LOWI0.2PUMPQ0.0LEVEL_HIGHI0.3PUMPQ0.0

Step by step

  1. 1Press ▶ Run (F5) and turn on the SYSTEM switch (I0.0). The tank starts almost empty, so the pump starts.
  2. 2As the level rises, the low switch gets covered but the pump keeps running: the PUMP contact branch keeps it on (seal-in).
  3. 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.
  4. 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.