Wonderware InTouch Tutorials - If Else End If Condition

For If condition practice first create new window configured as following

Tagnames as:-

All the lights as Light1 , Light2 , Light3 , Light4
Slider as slider

image

Right Click on window and go to “Window Script” and set ccondition type to “while showing” and every “100”.

image

type following code to the window.


IF slider<=30 THEN Light1 = 1;
ELSE Light1 = 0;
ENDIF;

IF slider>30 AND slider<60 THEN Light2=1;
ELSE Light2 = 0;
ENDIF;

IF slider>60 AND slider<80 THEN Light3=1;
ELSE Light3 = 0;
ENDIF;

IF slider>80 AND slider<=100 THEN Light4=1;
ELSE Light4 = 0;
ENDIF;


Take care of semicolon

image

click on Runtime on top Right window to Run the Program.

image

Output window screenshots

image

image

image

image