Automate using a window script
- Last UpdatedDec 18, 2024
- 2 minute read
A window script sets the operating conditions of the Liquid Fertilizer application while it is running in WindowViewer:
-
When the Liquid or Concentrate valves are open and the Outlet valve is closed, the tank fills with ingredients.
-
When the Liquid or Concentrate valves are open and the Outlet valve is open, the tank volume remains constant.
-
When the Liquid and Concentrate valves are closed and the Outlet valve is open, the liquid fertilizer empties from the tank.
-
When the mixing tank level is less than 1500 liters and the liquid or concentrate values are open, the tank begins to fill with ingredients.
-
When is the tank level is greater than 500 liters and the outlet valve is closed, the agitator begins to rotate.
-
When the tank level falls to less than 500 liters and the outlet valve is open, the agitator stops.
To create a window script
-
Right-click on a blank area of the Mixers window to show a shortcut menu.
-
Select Window Scripts from the shortcut menu.
-
Type or copy the following windows script into the Scripts dialog box.

You can select the following script text if you want to copy/paste to the InTouch script editor.
IF Tank_Level < 1500 AND (Valve_Liquid OR Agitator) THEN
Tank_Level = Tank_Level + 20;
ENDIF;
IF Tank_Level > 500 AND NOT (Valve_Outlet) THEN
Agitator_RPM = Agitator_RPM + 15;
ENDIF;
IF Tank_Level > 0 AND (Valve_Outlet) THEN
Tank_Level = Tank_Level - 20;
ENDIF;
IF Tank_Level < 500 AND NOT (Valve_Outlet) THEN
Agitator_RPM = Agitator_RPM == 0;
ENDIF;
-
Set the Condition Type field to While Showing.
-
Set the Every field to a value between 500-700 milliseconds.
The window script will run periodically at the interval you set in the Every field.
-
Select Validate to see if there are any errors in the script.
-
Correct any script errors and select OK.