QuickOPC User's Guide and Reference
EasyUADataChangeNotificationEventArgs Class
Members 



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.OperationModel Namespace : EasyUADataChangeNotificationEventArgs Class
Provides data for the OpcLabs.EasyOpc.UA.IEasyUAClient.DataChangeNotification event.
Object Model
EasyUADataChangeNotificationEventArgs ClassEasyUAMonitoredItemArguments ClassUAAttributeData ClassExceptionCollection ClassNormalizedExceptionCollection ClassNormalizedException ClassNormalizedException Class
Syntax
'Declaration
 
<CLSCompliantAttribute(True)>
<ComDefaultInterfaceAttribute(OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs)>
<ComVisibleAttribute(True)>
<GuidAttribute("5C9CCACB-A2CF-45FE-BD50-D7F9620868A1")>
<TypeConverterAttribute(System.ComponentModel.ExpandableObjectConverter)>
<SerializableAttribute()>
Public Class EasyUADataChangeNotificationEventArgs 
   Inherits EasyUAMonitoredItemChangedEventArgs
   Implements OpcLabs.BaseLib.OperationModel.ComTypes._OperationEventArgs, OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable 
'Usage
 
Dim instance As EasyUADataChangeNotificationEventArgs
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs)]
[ComVisible(true)]
[Guid("5C9CCACB-A2CF-45FE-BD50-D7F9620868A1")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[Serializable()]
public class EasyUADataChangeNotificationEventArgs : EasyUAMonitoredItemChangedEventArgs, OpcLabs.BaseLib.OperationModel.ComTypes._OperationEventArgs, OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
[CLSCompliant(true)]
[ComDefaultInterface(OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs)]
[ComVisible(true)]
[Guid("5C9CCACB-A2CF-45FE-BD50-D7F9620868A1")]
[TypeConverter(System.ComponentModel.ExpandableObjectConverter)]
[Serializable()]
public ref class EasyUADataChangeNotificationEventArgs : public EasyUAMonitoredItemChangedEventArgs, OpcLabs.BaseLib.OperationModel.ComTypes._OperationEventArgs, OpcLabs.EasyOpc.UA.OperationModel.ComTypes._EasyUADataChangeNotificationEventArgs, System.ICloneable, System.Runtime.Serialization.ISerializable, System.Xml.Serialization.IXmlSerializable  
Remarks

 

When there is a significant change related to monitored item you have subscribed to, the EasyUAClient object generates a  DataChangeNotification event. What constitutes a significant change is given by the data change filter specified when the subscription was created. For subscription mechanism to be useful, you should hook one or more event handlers to this event.

To be more precise, the DataChangeNotification event is actually generated in other cases, too.

First of all, you always receive at least one DataChangeNotification event notification after you make a subscription; this notification either contains the initial data for the item, or an indication that data is not currently available. This behavior allows your application to rely on the component to provide at least some information for each subscribed item.

Secondly, the DataChangeNotification event is generated every time the component loses connection to the monitored item, and when it reestablishes the connection. This way, your application is informed about any problems related to the item, and can process them accordingly if needed.

You will also receive the DataChangeNotification notification if the status of the item changes (not just its actual data value). In fact, you can influence whether the timestamp or value changes trigger a notification, with the Trigger property in UADataChangeFilter.

The DataChangeNotification event notification contains an EasyUADataChangeNotificationEventArgs argument. You will find all kind of relevant data in this object. Some properties in this object contain valid information no matter what kind of change the notification is about. These properties are in Arguments (containing also information such as SubscriptionParametersMonitoringParametersNodeDescriptorEndpointDescriptor and State).

For further processing, your code should always inspect the value of Exception property of the event arguments. If this property is set to a null reference, the notification carries an actual change in item’s data, and the AttributeData property has the new value, timestamps and status of the item, in form of UAAttributeData object. If the Exception property is not a null reference, there has been an error related to the item, and the AttributeData property is not valid. In such case, the Exception property contains information about the problem.

The DataChangeNotification event handler is called on a thread determined by the EasyUAClient component. For details, please refer to “Multithreading and Synchronization” chapter under “Advanced Topics”.

In short, however, we can say that if you are writing e.g. Windows Forms application, the component takes care of calling the event handler on the user interface thread of the form, making it safe for your code to update controls on the form, or do other form-related actions, from the event handler.

 

Inheritance Hierarchy

System.Object
   System.EventArgs
      OpcLabs.BaseLib.OperationModel.OperationEventArgs
         OpcLabs.EasyOpc.UA.OperationModel.EasyUAMonitoredItemChangedEventArgs
            OpcLabs.EasyOpc.UA.OperationModel.EasyUADataChangeNotificationEventArgs
               OpcLabs.EasyOpc.UA.Generic.EasyUADataChangeNotificationEventArgs<TValue>

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