Question:
How can I execute a script to open a screen whenever a Boolean tag’s value is 1 (one), and close it when it is 0 (zero)?
Solution:
To do so, follow these procedures:
- In the Boolean Tag, add an Alarm in High with value = 1
- In the Scripts window, create the following script in the OnAlarm event to open the screen: Screen.Show()
- Create a script in the OnAlarmReturn event to close the screen: Screen.Hide()
Thus, whenever the tag’s value is equal to 1 (one), the screen opens; whenecer it is equal to 0 (zero), it is closed.