30.09.2020

Guide on Creating a Level Shift Simulation in Tank via HMI Display

How to represent the level shift of tank as an analog signal on screen?

With INVT’s VT designer software, there is support for the ‘Bar Graph’ tool and a Macro program segment that will help make the simulation of an analog signal, specifically the tank’s level shift signal, as close to reality as possible.

Here are the steps:

Step 1:  Create Water Tank Parameters.

  • Click on icon in the ‘Toolbar’ -> Initialize the water tank.
  • Click on the water tank object -> General -> to configure properties, memory address.
  • Click on the ‘Scale’ tab to create a water level measurement scale.
  • Click on the ‘F.Macker’ tab, ‘F.Macker’ -> Create a slider.

mo-phong-luu-luong-trong-bon-hmi-1309.jpg

Step 2: Create Memory Data for the Water Tank and ‘High Level’ and ‘Low Level’.

Click on the ‘Advanced’ tab to assign memory addresses for ‘High Level’ and ‘Low Level’.

$U0 : Memory address for the water tank.

$U1 : Memory address for the low water level.

$U2 : Memory address for the high water level.

mo-phong-luu-luong-trong-bon-hmi-2309

Step 3: Write a Macro Program.

To understand how to write a Macro program in detail, you can refer to the article ‘Guide on Writing a Macro Program’.

Right-click on the ‘screen’ interface -> Screen properties -> Check ‘Cycle Macro’ -> Write the Macro program code.

mo-phong-luu-luong-trong-bon-hmi-3309

+ Analyze the ‘Cycle Macro’ code.

$U3 = $U1 +$U2  /// $U3 : Memory address containing the total value of high and low water levels
/// $U1: Memory address containing the Low Level value///
/// $U2: Memory address containing the High Level value///
If $U10.0 (B)  ////$U10.0 : Address bit for the on/off button to control system operation///
If $U0 <= $U3 // / $U0 =Memory address for recording the water level value in the water tank///
$U0=$U0+1
$U5=08 ///// #U5 : Bit 3 of the memory address containing the water pipe inlet address is set (to create the effect of water flowing into the tank).
ELSE
$U5=0 //// Reset water flow into the tank.
ENDIF
ENDIF

Step 4: Run the program simulation.

– Select ‘Compile’  ->  run offline simulation