CONTROL SYSTEMS / PORTFOLIO

PLC PROJECT / SOFTWARE SIMULATION

Tank level
control.

A CODESYS project that fills and drains a simulated tank, while an HMI shows the liquid level, its trend and the equipment state.

TANK-01HMI / AUTO MODE
CODESYS tank HMI in AUTO at 67%, with a repeating level trend, the inlet valve closed and the pump running.
Frame from the recorded CODESYS simulation.

01 / PURPOSE

Goal

  • Simulate a tank that alternates between filling and draining.
  • Show how an operator can monitor the level, switch modes, and operate the valve or pump manually.

02 / IMPLEMENTATION

Solution

  • Structured Text in PLC_PRG opens the inlet at 30% or below and starts draining at 70% or above.
  • Between 30% and 70%, xFilling remembers the previous direction. This is hysteresis.
  • While running, protection overrides normal or manual commands: at 10% or below it stops the pump and opens the inlet; at 90% or above it closes the inlet and starts the pump.
  1. 10%Low protection
  2. 30%Start filling
  3. 70%Start draining
  4. 90%High protection
View the Structured Text screenshot Online Structured Text showing start and stop logic, automatic direction, manual operation, alarms, and liquid level calculation.
View the PLC variable table Online PLC variables showing automatic setpoints of 30 and 70 percent and protection thresholds of 10 and 90 percent.

03 / DEMONSTRATION

Result

  • The HMI trend shows repeated filling and draining near the 30% and 70% marks in AUTO.
  • The recording also shows manual valve and pump operation, then a return to AUTO.
CODESYS SIMULATION00:34
Watch the liquid level, trend and right-hand status panel as the operating mode changes.