Using Tag Binding Inside Scripts

Using Tag Binding Inside Scripts (For the Screen Function)

The Wise SCADA screen function supports “tag binding,” which allows specific tags to be linked to the newly opened screen.
With tag binding, the screen can receive external tag values or use parameters associated with those tags. For more details, see: Tag Binding
Tag binding is done by defining one or more tags in a single string, separated by commas.

VB Example

Tag Binding String Definition

  • Dim Bind As String = “_Tag_1,_Tag_2”

Calling the Screen Function

  • Dim result As BOOL = SCADAFunction.Run(“Screen”, “Screen (1)”, “”, “New Window”, Bind, Nothing)

Explanation (VB)

  • The Bind variable contains the list of tags that will be bound when the screen opens.
  • Multiple tags must be written separated by commas:
    “_Tag_1,_Tag_2”
  • The fifth parameter in SCADAFunction.Run is the binding string.
  • Nothing is used for the unused final parameter.
  • With this structure, the new window opens with _Tag_1 and _Tag_2 automatically bound.

Note: In the VB script environment, SCADAFunction must be declared as an object inside MainClass.

C# Example

Tag Binding String Definition

  • string Bind = “_Tag_1,_Tag_2”;

Calling the Screen Function

  • BOOL result = SCADAFunctionRun(“Screen”, “Screen (1)”, “”, “New Window”, Bind, null);

Explanation (C#)

  • The Bind variable is defined in the same format-tag names separated by commas.
  • In C#, unused parameters must be written as null.
  • The fifth parameter determines which tags will be bound to the newly opened screen.

Leave a Reply