Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Operations Management Interface

Add a named script

  • Last UpdatedJul 16, 2024
  • 4 minute read

In addition to the built-in scripts that are triggered by the status of the layout, you can add scripts that are triggered by expressions, or by changes in values and/or data quality. These expression-based scripts are called "named scripts." You can configure a named script to run:

  • One time when an expression changes from false to true or true to false, or when a value or its quality changes. Scripts that use the On True, On False, and Data Change triggers will run once when the specified event occurs.

  • Periodically, at the specified interval, when the trigger is set to While True or While False.

Each added script can contain only one trigger type.

To add a named script to a layout

  1. Open the layout in the Layout Editor and select the Script tab.

  2. Click the Add Script AddScriptButton button.

  3. Select the Named Script choice from the pop-up window.

    Add new script dialog

  4. To rename the script from the default "Script00n," click or touch the script name in the Name field and edit the name.

  5. Click Add. The new script is created in the Scripts list.

    To rename the script after it has been added to the Scripts list, click or touch the script name and edit the name.

To configure a named script

  1. In the Expression field, enter an expression, value or reference. As you type, an autocomplete menu will present any valid items that start with the characters you are typing.

    The expression acts as data source for the script trigger.

  2. In the Trigger field, select the script trigger:

    • While True triggers the script to run periodically when the expression is true. The default period for While True scripts is 1000 ms. To change the period, enter a new value in the field.

    • While False triggers the script to run periodically when the expression is false. The default period for While False scripts is 1000 ms. To change the period, enter a new value in the field.

    • On True triggers the script to run one time when the expression transitions to true from false.

    • On False triggers the script to run one time when the expression transitions to false from true.

    • Data Change triggers the script one time when the value of the expression or its quality changes. You can specify a deadband value to filter insignificant changes. To trigger the script for changes to both value and quality, select the Quality Changes check box.

  3. If you are writing/editing a While True or While False script, specify the frequency that the script will be executed by entering an interval (in milliseconds) in the Period field.

    The Period field specifies the length of the interval from the start of one script execution cycle to the next, while the layout remains open. If the Period field is set to a very short interval, system performance may decrease. Enter an interval value in milliseconds.

    • Default: 1000 ms (one second)

    • Maximum: 360,000 ms (six minutes)

    Note: Data Timeout, Deadband, and Quality Changes fields are not applicable to, and are disabled for While Showing scripts.

  4. Enter your script in the main edit box. Autocomplete helps by displaying valid items, based on the initial characters you enter.

    • You can validate your script for syntax errors prior to saving by pressing the Validate Script Validate Layout Script icon button.

    • To clear all data entered for the the script, including the expression, press the Clear Script Clear Layout Script icon button. There is no undo for this action.

  5. To save the script, select the Save Save Layout icon or Save and Close Save and Close Layout icon button.

  6. The script is validated automatically. If there are warnings or errors generated, a dialog listing the errors is displayed. You have the following options:

    • Select Yes to save the script and preserve the errors.

    • Select No to discard the changes you made to the script. If you selected Save and Close, the Layout editor closes and you will lose any changes you made to the script. If you selected Save, the Layout Editor remains open and you can resume editing the script.

    • Select Cancel to resume editing the script. The Layout Editor remains open and you can resume editing the script.

    TitleResults for “How to create a CRG?”Also Available in