Create a window script
- Last UpdatedJun 04, 2025
- 2 minute read
A window script sets the operating conditions of the Chocolate Milk application while it is running in WindowViewer:
-
When the Chocolate or Milk valves are open and the Outlet valve is closed, the tank fills with ingredients.
-
When the Chocolate or Milk valves are open and the Outlet valve is open, the tank volume remains constant.
-
When the Chocolate and Milk valves are closed and the Outlet valve is open, the chocolate milk empties from the tank.
-
When the mixing tank level is less than 1500 liters and the chocolate or milk 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.
Create a window script
-
Right-click on a blank area of the Mixing Station 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.

-
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.