QuickOPC User's Guide and Reference
Examples - OPC Unified Architecture - Subscribe to single node with absolute deadband
// This example shows how to subscribe to changes of a monitored item with absolute deadband.

using System;
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.OperationModel;

namespace UADocExamples._EasyUAClient
    partial class SubscribeDataChange
        public static void AbsoluteDeadband()
            UAEndpointDescriptor endpointDescriptor =
            // or "http://opcua.demo-this.com:51211/UA/SampleServer" (not in .NET Standard)
            // or "https://opcua.demo-this.com:51212/UA/SampleServer/"

            // Instantiate the client object and hook events
            var client = new EasyUAClient();
            client.DataChangeNotification += client_DataChangeNotification_AbsoluteDeadband;

            const double absoluteDeadband = 50;
            Console.WriteLine($"Subscribing with absolute deadband {absoluteDeadband}...");
            // The UADataChangeFilter has an implicit conversion from Double, which creates a filter with the specified
            // absolute deadband.
                "nsu=http://test.org/UA/Data/ ;i=11194",    // /Data.Dynamic.AnalogScalar.Int32Value
                dataChangeFilter: absoluteDeadband);

            Console.WriteLine("Processing data change events for 20 seconds...");
            System.Threading.Thread.Sleep(20 * 1000);


            Console.WriteLine("Waiting for 5 seconds...");
            System.Threading.Thread.Sleep(5 * 1000);

        static void client_DataChangeNotification_AbsoluteDeadband(object sender, EasyUADataChangeNotificationEventArgs e)
            // Display value
            if (e.Succeeded)
                Console.WriteLine("Value: {0}", e.AttributeData.Value);
                Console.WriteLine("*** Failure: {0}", e.ErrorMessageBrief);


See Also


Examples - Reactive Programming