Wonderware InTouch Tutorials - Tank Filling Example

Learn Wonderware InTouch Tutorials using Tank Filling Example Program.

Tank Filling Example

  1. Create window Tagname as shown in below window

Wonderware InTouch Tank Filling Example

add below code in window script --> onshow


v1 = 0;
v2 = 0;
v3 = 0;
tank1 = 0;
tank2 = 0;
sw1 = 0;
s1 = 0;
s2 = 0;
s3 = 0;
s4 = 0;

*****************************************

  1. Add below code in Window script --> while show

IF tank1 == 100 THEN
s1 =1;
ELSE s1 = 0;
ENDIF;

IF tank1 == 0 THEN s2 = 0;
ELSE s2 = 1;
ENDIF;

IF tank2 == 200 THEN s3 = 1; ELSE s3 =0; ENDIF;

IF tank2 == 0 THEN s4 = 0; ELSE s4 = 1; ENDIF;

IF s1 ==1 AND s2 == 1 THEN v3 = 1; v1 =0; v2 =0;
ENDIF;

IF s1 == 0 AND s2 ==0 THEN v3 =0; v1 = 1 ; v2 = 1;
ENDIF;

IF s3 ==1 AND s4 ==1 THEN v3 = 0;
ENDIF;

IF v1 ==1 AND v2 == 1 THEN
tank1 = tank1 + 1;
ENDIF;

IF v3 == 1 THEN
tank1 = tank1 - 1;
tank2 = tank2 + 1;
ENDIF;


Wonderware InTouch Tank Filling Program

Wonderware InTouch Tank Filling Graphics