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

AVEVA™ Operations Management Interface

Example of configuring an event script for the TagPicker control

Example of configuring an event script for the TagPicker control

  • Last UpdatedNov 06, 2024
  • 2 minute read

Install and embed the TagPicker control into a graphic as described in:

In this example, when one of the tags is picked by double-clicking on it, a message is logged in the Log Viewer.

First however, you need to:

  • Import the script function library from the file aaHistClientDatabase.dll.

  • Configure a connection to a valid and running Historian Server.

To import the script functions from aaHistClientDatabase.dll

  1. On the Home ribbon, select Galaxy, then select Import.

  2. Select Visualization, then Client Controls. The Import Client Controls dialog box appears.

  3. Browse to the aaHistClientDatabase.dll and select it. By default, this file is in the C:\Program Files (x86)\ArchestrA\Framework\Bin\ViewAppFramework\SharedLibsfolder.

  4. Click Open. The import starts and finishes with a message.

  5. Click OK.

To connect the TagPicker control to the Historian Server

  1. On the canvas, place a button next to the TagPicker control.

  2. Double-click the button. The Edit Animations dialog box appears.

  3. Add an Action Script animation to the animation list.

  4. In the script area, type the following script:

    Dim NewServer as ArchestrA.HistClient.Database.aaServer;

    Dim statusMessage as String;

    NewServer = aaTagPicker1.Servers.Add("MyHistorian");

    NewServer.LoginID = "MyUserName";

    NewServer.Password = "MyPassword";

    NewServer.LogOn( statusMessage );

    LogMessage ("Connection" + statusMessage);

    In the script, replace the strings MyHistorian, MyUserName and MyPassword with the Historian server name, a valid user name, and a password to connect to the server.

  5. Close the Edit Animations dialog box.

    You can now configure the client control event to log a message every time the user picks one or more tags by double-clicking on them:

    1. In the Industrial Graphic Editor, double-click the embedded ActiveFactory TagPicker control.

    2. In the animation list, click Event.

    3. In the Event list, click the OnTagsPicked event.

    4. In the script area, type the following:

      LogMessage("User picked one or more tags.");

    5. Save and close the Edit Animations dialog box.

    6. Save and close the Industrial Graphic Editor.

    7. Embed the graphic in a managed InTouch application.

    8. Switch to runtime and connect to a valid IndustrialSQL Server source.

    9. Double-click on one of the tags in the TagPicker control.

    10. Check the SMC Log Viewer. The message "User picked one or more tags" appears.

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