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

AVEVA™ InTouch HMI

Use indirect tags with scripts

  • Last UpdatedJun 25, 2024
  • 2 minute read

You can use scripts to assign input source tags to an indirect tag. You assign an input source tag to an indirect tag by assigning the source tag’s name to the indirect tag’s .Name dotfield.

For example, if you create an indirect analog tag called IndPumpRPM, the two source PumpRPM tags are assigned to it with script statements similar to the following example:

IF PumpNo == 1 THEN

IndPumpRPM.Name = "PumpRPM1";

ELSE

IndPumpRPM.Name = "PumpRPM2";

ENDIF;

The indirect tag assignment script can be triggered by an application event or an operator action like selecting a window button.

When you equate an indirect tag to another source tag, the indirect tag behaves as if it is the source tag. If the value of the source tag changes, the indirect tag reflects the change. If the indirect tag's value changes, the source tag changes accordingly.

Because the .Name dotfield of an indirect tag is a simple string, you can dynamically assign the indirect tag target at run time. For example, if you create a Data Change QuickScript that runs each time the value of the Number tag changes, the source tag assigned to the indirect IndPumpRPM tag changes accordingly:

IndPumpRPM.Name = "PumpRPM" + Text(Number, "#" );

When this script runs, the value of the analog tag Number is converted to text and appended to the string PumpRPM. If Number equals 1, this sets the name of the indirect IndPumpRPM tag to PumpRPM1.

Indirect analog-type tags are used for both integer and real tags. Indirect tags can be mapped to any other tag as long they are the same tag type.

You can also assign retentive attributes to indirect tags. With retention, the indirect tag retains its most recent tag assignment when the application starts again.

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