OPC Studio User's Guide and Reference
OnDataSubscriptionChanged(IUADataSubscription,UADataSubscriptionChangedAction) Method



OpcLabs.ServerOpcUA Assembly > OpcLabs.EasyOpc.UA.NodeSpace Namespace > UADataVariable Class > OnDataSubscriptionChanged Method : OnDataSubscriptionChanged(IUADataSubscription,UADataSubscriptionChangedAction) Method
The data subscription that is the subject of the change.

The value of this parameter cannot be null (Nothing in Visual Basic).

Describes how the data subscription has changed (add/remove/modify).
Called when a data subscription has been added to, removed from, or modified in the DataSubscriptionSet of this data variable.
Syntax
'Declaration
 
Protected Overloads Overridable Function OnDataSubscriptionChanged( _
   ByVal dataSubscription As IUADataSubscription, _
   ByVal action As UADataSubscriptionChangedAction _
) As Boolean
'Usage
 
Dim instance As UADataVariable
Dim dataSubscription As IUADataSubscription
Dim action As UADataSubscriptionChangedAction
Dim value As Boolean
 
value = instance.OnDataSubscriptionChanged(dataSubscription, action)
protected virtual bool OnDataSubscriptionChanged( 
   IUADataSubscription dataSubscription,
   UADataSubscriptionChangedAction action
)
protected:
virtual bool OnDataSubscriptionChanged( 
   IUADataSubscription^ dataSubscription,
   UADataSubscriptionChangedAction action
) 

Parameters

dataSubscription
The data subscription that is the subject of the change.

The value of this parameter cannot be null (Nothing in Visual Basic).

action
Describes how the data subscription has changed (add/remove/modify).
Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

This method provides a hook for derived classes to react to changes in data subscriptions, allowing for custom logic to be executed when the data subscriptions to this variable's data change.

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