Topic 6.2.4: Condition Script

Configuring Condition Scripts

Condition scripts are triggered depending on when certain logical conditions are fulfilled. Use condition scripts to execute a script:

  • One time when a condition is fulfilled.
  • One time when a condition is not fulfilled.
  • Periodically while a certain condition is fulfilled.
  • Periodically while a certain condition is not fulfilled.

A condition script is identified by the condition syntax that initiates the script. For example: tag1>=13.

 Note: A script that is assigned the On True condition type only executes if the condition transitions from False to True. A script that is assigned the On False condition type only executes if the condition transitions from True to False.

To configure a condition script

1. Using the Classic View, in the Scripts pane either:

  • Right-click Condition and click New. The Condition Scripts dialog box appears.

  • To edit an existing condition script, click the plus sign next to Condition, right-click the condition script name, and click Edit. The Edit Condition Script dialog box appears.

2. In the Condition box, type the expression that you want to use as the condition.

3. You can enter a comment in the Comment box.

4. In the Condition Type list, do one of the following:

  • Click On False to configure a script to execute one time when the condition becomes false.
  • Click While False to configure a script to execute periodically while the condition is false.
  • Click On True to configure a script to execute one time when the condition becomes true.
  • Click While True to configure a script to execute periodically while the condition is true.

5. If you selected While False or While True in the previous step, type a time interval between 1 and 360000 milliseconds in the Every box.

6. Type your script, or modify the existing script in the window.

7. Click OK.

To delete all condition scripts that are associated with a condition

  • Using the Classic View, in the Scripts pane, expand Condition, right-click the condition script name and click Delete. When a message appears, click Yes.

To delete individual condition scripts that are associated with a condition

1. Using the Classic View, in the Scripts pane, expand Condition, right-click the key script name and click Edit. The Edit Condition Script dialog box appears.

2. In the Condition Type list, click the script trigger for the script to delete. The script appears in the main section of the Edit Condition Script dialog box.

3. On the Edit menu, click Clear. The script from the main section clears and the associated script is deleted.

Last modified: Saturday, 7 March 2020, 2:53 PM