QuickOPC User's Guide and Reference
AENotificationObservable Class
Members  Example 



OpcLabs.EasyOpcClassic Assembly > OpcLabs.EasyOpc.AlarmsAndEvents.Reactive Namespace : AENotificationObservable Class
Push-based notification provider (observable) for OPC Alarms&Events notifications.
Object Model
AENotificationObservable ClassEasyAEClientSelector Class
Syntax
'Declaration
 
<ComVisibleAttribute(False)>
<TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
<CLSCompliantAttribute(True)>
<ValueControlAttribute("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=False, 
   Export=True, 
   PageId=10001)>
<SerializableAttribute()>
Public Class AENotificationObservable 
   Inherits AEReactive
   Implements LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, System.ICloneable, System.IObservable(Of EasyAENotificationEventArgs), System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable 
'Usage
 
Dim instance As AENotificationObservable
[ComVisible(false)]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public class AENotificationObservable : AEReactive, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, System.ICloneable, System.IObservable<EasyAENotificationEventArgs>, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
[ComVisible(false)]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[CLSCompliant(true)]
[ValueControl("OpcLabs.BaseLib.Forms.Common.ObjectSerializationControl, OpcLabs.BaseLibForms, Version=5.72.465.1, Culture=neutral, PublicKeyToken=6faddca41dacb409", 
   DefaultReadWrite=false, 
   Export=true, 
   PageId=10001)]
[Serializable()]
public ref class AENotificationObservable : public AEReactive, LINQPad.ICustomMemberProvider, OpcLabs.BaseLib.ComTypes._Info, OpcLabs.BaseLib.ComTypes._Object2, System.ICloneable, System.IObservable<EasyAENotificationEventArgs>, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
Example

.NET

// Shows how to create an observable for OPC-A&E notifications, and subscribe to it.

using System;
using System.Threading;
using OpcLabs.EasyOpc.AlarmsAndEvents.Reactive;

namespace ReactiveDocExamples
{
    namespace _AENotificationObservable
    {
        class Subscribe
        {
            public static void Main1()
            {
                Console.WriteLine("Creating observable...");
                AENotificationObservable events =
                    AENotificationObservable.Create("", "OPCLabs.KitEventServer.2", 1000);

                Console.WriteLine("Subscribing...");
                using (events.Subscribe(e => Console.WriteLine(
                    (e.Exception is null) ? (e.EventData?.Message ?? "") : e.Exception.GetBaseException().ToString())))
                {
                    Console.WriteLine("Waiting for 10 seconds...");
                    Thread.Sleep(10*1000);

                    Console.WriteLine("Unsubscribing...");
                }

                Console.WriteLine("Waiting for 2 seconds...");
                Thread.Sleep(2 * 1000);
            }
        }
    }
}
Inheritance Hierarchy

System.Object
   OpcLabs.BaseLib.Object2
      OpcLabs.BaseLib.Info
         OpcLabs.EasyOpc.AlarmsAndEvents.Reactive.AEReactive
            OpcLabs.EasyOpc.AlarmsAndEvents.Reactive.AENotificationObservable

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also