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

AVEVA Enterprise SCADA PubSub API Reference

Subscribe with a global connection

This scenario guides you through the steps required to subscribe with a global connection.

To identify the code associated with each step, see the code comments in the Example code section.

To subscribe with a global connection

  1. Open the Program.cs file from the created project.
  2. Connect to a global PubSub connection.
  3. Confirm there is a connection with the PubSub system.
  4. Subscribe to a PubSub topic.

Example code

internal void AddSubscriptionWithGlobalPubSubConnection()
{
    try
    {
        // Connect to a global PubSub connection.
        IGlobalPubSubConnectionAccessor globalPubSubConnection = new GlobalPubSubConnectionAccessor();
        var sharedPubsubConnection = globalPubSubConnection.GlobalConnection;
        // Confirm there is a connection with the PubSub system.
        if (sharedPubsubConnection.IsConnected())
        {
            var topic = "es.realtime.db.analog.DeviceRollupAnalog01.curval";
            // Subscribe to a PubSub topic.
            var subscription = sharedPubsubConnection.Subscribe(topic);
        }
    }
    catch (Exception ex)
    {
        Console.WriteLine("Error:" + ex.Message);
    }
}
TitleResults for “How to create a CRG?”Also Available in