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

AVEVA™ Plant SCADA

Use Arguments in Labels

  • Last UpdatedJul 18, 2023
  • 2 minute read

You can Define a Label that accept arguments enclosed in parentheses (). The following example shows a label that increments a variable by a specific value:

Label Name

Inc(X, STEP)

Expression

X = X + STEP

Here, "X" is the variable to be incremented and "STEP" determines the amount of the increment. You can then use this label in a command, as in the following example:

Key Sequence

FastInc

Command

Inc(SP12, 10);

An operator can use this command to increment the value of SP12 by 10.

You can also use arguments in a label in the following ways:

Specify a Default Value for an Argument

You can specify a default value for an argument when you define a label, for example:

Label Name

Inc(X, STEP = 10)

Expression

X = X + STEP

When you subsequently use this label without any arguments in a command, the default value is used, for example:

Key Sequence

FastInc

Command

Inc(SP12);

Use a Substitution String in an Argument

You can pass a string substitution as an argument in a label, for when several variables have part of the variable name in common; for example:

Label Name

SPDev(TAG)

Expression

Prompt("Deviation=" + "IntToStr(CP##TAG## - SP##TAG##));

In the above example, TAG is the common portion of the variable name, and is substituted at each occurrence in the expression. To display the difference between two variables CP123 and SP123, you would specify SPDev(123) in a command, for example:

Command

SPDev(123);

You cannot use a substitution within a string. In the following example, the DESC Parameter (a text description) will not be substituted as it is between quotation marks:

Prompt("Deviation for ##DESC##=" + "IntToStr(CP##TAG## -
SP##TAG##))

See Also

Convert Values into Strings

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