.NET Based OPC UA Client/Server SDK  3.3.3.537
UnifiedAutomation.UaClient.Subscription Class Reference

A class that manages a subscription with an OPC UA server. More...

Public Member Functions

 Subscription (Session session)
 Initializes a new instance of the Subscription class. More...
 
virtual void Save (IEncoder encoder)
 Saves the Subscription using the specified encoder. More...
 
virtual void Load (IDecoder decoder)
 Initializes the Subscription using the specified decoder. More...
 
virtual void SaveAll (BinaryEncoder encoder)
 Saves the Subscription using the specified encoder including the revised parameters by the server and the MonitoredItems More...
 
virtual void LoadAll (BinaryDecoder decoder)
 Initializes the Subscription using the specified decoder including the revised parameters by the server and the MonitoredItems. More...
 
void Create ()
 Creates a new subscription on the server. More...
 
void Create (RequestSettings settings)
 Creates a new subscription on the server. More...
 
IAsyncResult BeginCreate (RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronously creates a new subscription on the server. More...
 
void EndCreate (IAsyncResult result)
 Completes an asynchronous operation to create a subscription. More...
 
void Modify ()
 Modifies a subscription. More...
 
void Modify (RequestSettings settings)
 Modifies a subscription. More...
 
IAsyncResult BeginModify (RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronously modifies a subscription. More...
 
void EndModify (IAsyncResult result)
 Completes an asynchronous operation to modify a subscription. More...
 
void Delete ()
 Deletes a subscription. More...
 
void Delete (RequestSettings settings)
 Deletes a subscription. More...
 
IAsyncResult BeginDelete (RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronously deletes a subscription. More...
 
void EndDelete (IAsyncResult result)
 Completes an asynchronous operation to delete a subscription. More...
 
void Transfer (uint subscriptionId, List< uint > availableSequenceNumbers, RequestSettings settings)
 Transfers the subscription with the specified subscription id. More...
 
void Recreate (RequestSettings settings)
 Recreates the subscription. More...
 
void Recreate (NamespaceTable oldNamespaceUris, RequestSettings settings)
 Recreates the subscription. More...
 
List< StatusCodeCreateMonitoredItems (IList< MonitoredItem > monitoredItems)
 Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
List< StatusCodeCreateMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
List< StatusCodeCreateMonitoredItems (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings)
 Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
IAsyncResult BeginCreateMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
IAsyncResult BeginCreateMonitoredItems (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
List< StatusCodeEndCreateMonitoredItems (IAsyncResult result)
 Ends an asynchronous operation to create monitored items. More...
 
List< StatusCodeModifyMonitoredItems (IList< MonitoredItem > monitoredItems)
 Modifies monitored items. More...
 
List< StatusCodeModifyMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Modifies monitored items. More...
 
List< StatusCodeModifyMonitoredItems (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings)
 Modifies monitored items. More...
 
IAsyncResult BeginModifyMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous call to modify monitored items. More...
 
IAsyncResult BeginModifyMonitoredItems (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous call to modify monitored items. More...
 
List< StatusCodeEndModifyMonitoredItems (IAsyncResult result)
 Ends an asynchronous operation to modify monitored items. More...
 
List< StatusCodeDeleteMonitoredItems (IList< MonitoredItem > monitoredItems)
 Deletes monitored items. More...
 
List< StatusCodeDeleteMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Deletes monitored items. More...
 
IAsyncResult BeginDeleteMonitoredItems (IList< MonitoredItem > monitoredItems, RequestSettings settings, AsyncCallback callback, object userData)
 Deletes monitored items. More...
 
List< StatusCodeEndDeleteMonitoredItems (IAsyncResult result)
 Ends an asynchronous operation to delete monitored items. More...
 
List< StatusCodeSetMonitoringMode (MonitoringMode monitoringMode, IList< MonitoredItem > monitoredItems)
 Sets the monitoring mode for a list of monitored items. More...
 
List< StatusCodeSetMonitoringMode (MonitoringMode monitoringMode, IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Sets the monitoring mode for a list of monitored items. More...
 
IAsyncResult BeginSetMonitoringMode (MonitoringMode monitoringMode, IList< MonitoredItem > monitoredItems, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous call to set the monitoring mode for a list of monitored items. More...
 
List< StatusCodeEndSetMonitoringMode (IAsyncResult result)
 Ends an asynchronous operation to set the monitoring mode for monitored items. More...
 
SetTriggeringResult SetTriggering (MonitoredItem triggeringItem, IList< MonitoredItem > linksToAdd, IList< MonitoredItem > linksToRemove, RequestSettings settings)
 Change the triggering for a monitored item. More...
 
IAsyncResult BeginSetTriggering (MonitoredItem triggeringItem, IList< MonitoredItem > linksToAdd, IList< MonitoredItem > linksToRemove, RequestSettings settings, AsyncCallback callback, object userData)
 Begins a request to change the triggering for a monitored item. More...
 
SetTriggeringResult EndSetTriggering (IAsyncResult result)
 Ends a request to change the triggering for a monitored item. More...
 
NotificationMessage Republish (uint retransmitSequenceNumber)
 Republish call to get lost notification messages. More...
 
NotificationMessage Republish (uint retransmitSequenceNumber, RequestSettings settings)
 Republish call to get lost notification messages. More...
 
IAsyncResult BeginRepublish (uint retransmitSequenceNumber, RequestSettings settings, AsyncCallback callback, object userData)
 Asynchronous republish call to get lost notification messages. More...
 
NotificationMessage EndRepublish (IAsyncResult result)
 Ends an asynchronous operation to republish lost notification messages. More...
 
Task CreateAsync (RequestSettings settings)
 Asynchronously creates a new subscription on the server. More...
 
Task ModifyAsync (RequestSettings settings)
 Asynchronously modifies a subscription. More...
 
Task DeleteAsync (RequestSettings settings)
 Asynchronously deletes a subscription. More...
 
Task< List< StatusCode > > CreateMonitoredItemsAsync (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
Task< List< StatusCode > > CreateMonitoredItemsAsync (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings)
 Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items. More...
 
Task< List< StatusCode > > ModifyMonitoredItemsAsync (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Asynchronous call to modify monitored items. More...
 
Task< List< StatusCode > > ModifyMonitoredItemsAsync (IList< MonitoredItem > monitoredItems, TimestampsToReturn timestampsToReturn, RequestSettings settings)
 Asynchronous call to modify monitored items. More...
 
Task< List< StatusCode > > DeleteMonitoredItemsAsync (IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Deletes monitored items. More...
 
Task< List< StatusCode > > SetMonitoringModeAsync (MonitoringMode monitoringMode, IList< MonitoredItem > monitoredItems, RequestSettings settings)
 Asynchronous call to set the monitoring mode for a list of monitored items. More...
 
Task< SetTriggeringResultSetTriggeringAsync (MonitoredItem triggeringItem, IList< MonitoredItem > linksToAdd, IList< MonitoredItem > linksToRemove, RequestSettings settings)
 Begins a request to change the triggering for a monitored item. More...
 
Task< NotificationMessageRepublishAsync (uint retransmitSequenceNumber, RequestSettings settings)
 Asynchronous republish call to get lost notification messages. More...
 

Properties

Session Session [get]
 Gets the session the subscription is associated with. More...
 
SubscriptionConnectionStatus ConnectionStatus [get]
 Gets the connection status for the subscription. More...
 
uint SubscriptionId [get, set]
 Gets the subscription id. More...
 
Object UserData [get, set]
 Gets or sets the user data. More...
 
TimestampsToReturn DefaultTimestampsToReturn [get, set]
 Gets or sets the default timestamp to return. More...
 
RequestSettings DefaultRequestSettings [get, set]
 Gets or sets the default request settings for the subscription. More...
 
double PublishingInterval [get, set]
 Gets or sets the publishing interval (in milliseconds). More...
 
double CurrentPublishingInterval [get, set]
 Gets the publishing interval (in milliseconds) currently set on the server. More...
 
double Lifetime [get, set]
 Gets or sets the lifetime (in milliseconds). More...
 
double CurrentLifetime [get, set]
 Gets the lifetime of the Subscription (in milliseconds) currently set on the server. More...
 
double MaxKeepAliveTime [get, set]
 Gets or sets the maximum keep alive time (in milliseconds). More...
 
double CurrentMaxKeepAliveTime [get, set]
 Gets the maximum keep alive time (in milliseconds) currently set on the server. More...
 
uint MaxNotificationsPerPublish [get, set]
 Gets or sets the maximum number of notifications per publish. More...
 
uint CurrentMaxNotificationsPerPublish [get, set]
 Gets the maximum number of notifications per publish currently set on the server. More...
 
bool PublishingEnabled [get, set]
 Gets or sets a value indicating whether publishing is enabled. More...
 
bool CurrentPublishingEnabled [get, set]
 Gets a value indicating whether publishing is currently enabled on the server. More...
 
byte Priority [get, set]
 Gets or sets the priority of the subscription. More...
 
byte CurrentPriority [get, set]
 Gets the priority of the subscription currently set on the server. More...
 
MonitoredItem[] MonitoredItems [get]
 Gets the monitored items in the subscription. More...
 

Events

DataChangedEventHandler DataChanged
 Occurs when any subscribed data value has changed. More...
 
NewEventsEventHandler NewEvents
 Occurs when any new event has arrived. More...
 
SubscriptionStatusChangedEventHandler StatusChanged
 Occurs when the status of subscription changes. More...
 
NotificationMessageReceivedEventHandler NotificationMessageReceived
 Occurs when a new notification message arrives. More...
 
MissingSequenceNumberEventHandler MissingSequenceNumber
 Occurs when a sequence number is missing. More...
 
SubscriptionRecreatedEventHandler Recreated
 Occurs when a Subscription is automatically recreated after a successful reconnect. More...
 

Detailed Description

A class that manages a subscription with an OPC UA server.

The approach to create a new subscription on the server is:

The Subscription class contains several properties to set or change the settings of the subscription. Note that these parameters come in pairs: [ParameterName] and Current[ParameterName] (e.g. PublishingInterval and CurrentPublishingInterval). The first one is used to set the parameter inside the subscription object before calling Create() or Modify(), the second one reflects the value that is currently set on the server.

Note that some of the subscription settings requested by the client may be revised by the server.

See Subscription Overview and OPC UA Client/Server Subscription Concept for a more general description.

Constructor & Destructor Documentation

UnifiedAutomation.UaClient.Subscription.Subscription ( Session  session)

Initializes a new instance of the Subscription class.

The following standard settings are used:

Parameters
sessionThe session to associate the subscription with.

Member Function Documentation

IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginCreate ( RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronously creates a new subscription on the server.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndCreate method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginCreateMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.

If this method is called before the Subscription is created, the MonitoredItems are saved and the return status is GoodCallAgain. The MonitoredItems will be automatically created after the Subscription is created. Any errors are reported in the LastError property of the MonitoredItem object.

Returns
An object which must be passed to the EndCreateMonitoredItems method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginCreateMonitoredItems ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
timestampsToReturnIndicates whether server and / or source timestamps are returned.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.

If this method is called before the Subscription is created, the MonitoredItems are saved and the return status is GoodCallAgain. The MonitoredItems will be automatically created after the Subscription is created. Any errors are reported in the LastError property of the MonitoredItem object.

Returns
An object which must be passed to the EndCreateMonitoredItems method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginDelete ( RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronously deletes a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndDelete method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginDeleteMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Deletes monitored items.

Parameters
monitoredItemsA list of monitored items to delete.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndDeleteMonitoredItems method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginModify ( RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronously modifies a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndModify method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginModifyMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous call to modify monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndModifyMonitoredItems method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginModifyMonitoredItems ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous call to modify monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
timestampsToReturnOPC UA defines two timestamps, the source and the server timestamp. This parameter allows the client to define which timestamps the server should return with the value.
The source timestamp is only available for Value Attributes. The source timestamp is used to reflect the timestamp that was applied to a Variable value by the data source. It should indicate the last change of the value or status code. The source timestamp must be always generated by the same physical clock. This timestamp type was added for OPC UA to cover the use case to get the timestamp of the last value change which is different than the server timestamp definition.
The server timestamp is used to reflect the time that the server received a Variable value or knew it to be accurate if the changes are reported by exception and the connection to the data source is operating. This is the behavior expected by Classic OPC
Possible values are
  • TimestampsToReturn.Source
  • TimestampsToReturn.Server
  • TimestampsToReturn.Both
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndModifyMonitoredItems method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginRepublish ( uint  retransmitSequenceNumber,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous republish call to get lost notification messages.

Parameters
retransmitSequenceNumberThe sequence number of a notification message to be republished.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndRepublish method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginSetMonitoringMode ( MonitoringMode  monitoringMode,
IList< MonitoredItem monitoredItems,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Asynchronous call to set the monitoring mode for a list of monitored items.

Parameters
monitoringModeThe new monitoring mode. Possible values are Disabled, Sampling, and Reporting.
monitoredItemsA list of monitored items.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
callbackThe callback to use when the async call completes.
userDataThe user data that is passed to the callback.
Returns
An object which must be passed to the EndSetMonitoringMode method.
IAsyncResult UnifiedAutomation.UaClient.Subscription.BeginSetTriggering ( MonitoredItem  triggeringItem,
IList< MonitoredItem linksToAdd,
IList< MonitoredItem linksToRemove,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)

Begins a request to change the triggering for a monitored item.

This method allows to specify items that are reported only when some other item (the triggering item) triggers. This is done by creating links between the triggered items and the items to report.The monitoring mode of the items to report is set to sampling-only so that it will sample and queue Notifications without reporting them.

Parameters
triggeringItemThe monitored item which triggers other monitored items when it reports. This item shall belong to this Subscription.
linksToAddThe list of monitored items which report when the trigger changes. These MonitoredItems shall belong to this Subscription. The MonitoringMode of these MonitoredItems should be MonitoringMode.Sampling.
linksToRemoveThe list of monitored items previously added which should no longer report when the trigger changes.
settingsThe settings.
callbackThe callback.
userDataThe user data.
Returns
The object used to manage the state of the asynchronous operation.
void UnifiedAutomation.UaClient.Subscription.Create ( )

Creates a new subscription on the server.

void UnifiedAutomation.UaClient.Subscription.Create ( RequestSettings  settings)

Creates a new subscription on the server.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Task UnifiedAutomation.UaClient.Subscription.CreateAsync ( RequestSettings  settings)

Asynchronously creates a new subscription on the server.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes when the subscription is created.
Note
This method is not available on .NET framework versions prior 4.5.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.CreateMonitoredItems ( IList< MonitoredItem monitoredItems)

Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
Returns
A list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.CreateMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.CreateMonitoredItems ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings 
)

Creates a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
timestampsToReturnOPC UA defines two timestamps, the source and the server timestamp. This parameter allows the client to define which timestamps the server should return with the value.
The source timestamp is only available for Value Attributes. The source timestamp is used to reflect the timestamp that was applied to a Variable value by the data source. It should indicate the last change of the value or status code. The source timestamp must be always generated by the same physical clock. This timestamp type was added for OPC UA to cover the use case to get the timestamp of the last value change which is different than the server timestamp definition.
The server timestamp is used to reflect the time that the server received a Variable value or knew it to be accurate if the changes are reported by exception and the connection to the data source is operating. This is the behavior expected by Classic OPC
Possible values are
  • TimestampsToReturn.Source
  • TimestampsToReturn.Server
  • TimestampsToReturn.Both
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.CreateMonitoredItemsAsync ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.

If this method is called before the Subscription is created, the MonitoredItems are saved and the return status is GoodCallAgain. The MonitoredItems will be automatically created after the Subscription is created. Any errors are reported in the LastError property of the MonitoredItem object.

Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.CreateMonitoredItemsAsync ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings 
)

Asynchronous call to create a list of monitored items in the subscription. The monitored items could be data monitored items or event monitored items.

Parameters
monitoredItemsA list of monitored items to create.
timestampsToReturnIndicates whether server and / or source timestamps are returned.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.

If this method is called before the Subscription is created, the MonitoredItems are saved and the return status is GoodCallAgain. The MonitoredItems will be automatically created after the Subscription is created. Any errors are reported in the LastError property of the MonitoredItem object.

Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
void UnifiedAutomation.UaClient.Subscription.Delete ( )

Deletes a subscription.

void UnifiedAutomation.UaClient.Subscription.Delete ( RequestSettings  settings)

Deletes a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Task UnifiedAutomation.UaClient.Subscription.DeleteAsync ( RequestSettings  settings)

Asynchronously deletes a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes when the subscription was deleted.
Note
This method is not available on .NET framework versions prior 4.5.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.DeleteMonitoredItems ( IList< MonitoredItem monitoredItems)

Deletes monitored items.

Parameters
monitoredItemsA list of monitored items to delete.
Returns
A list of StatusCodes that indicate for each monitored item whether the DeleteMonitoredItem operation has been successful.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.DeleteMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Deletes monitored items.

Parameters
monitoredItemsA list of monitored items to delete.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the DeleteMonitoredItem operation has been successful.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.DeleteMonitoredItemsAsync ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Deletes monitored items.

Parameters
monitoredItemsA list of monitored items to delete.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the DeleteMonitoredItem operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
void UnifiedAutomation.UaClient.Subscription.EndCreate ( IAsyncResult  result)

Completes an asynchronous operation to create a subscription.

Parameters
resultThe object returned from the BeginCreate method.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.EndCreateMonitoredItems ( IAsyncResult  result)

Ends an asynchronous operation to create monitored items.

Parameters
resultThe object returned from the BeginCreateMonitoredItems method.
Returns
A list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
void UnifiedAutomation.UaClient.Subscription.EndDelete ( IAsyncResult  result)

Completes an asynchronous operation to delete a subscription.

Parameters
resultThe object returned from the BeginDelete method.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.EndDeleteMonitoredItems ( IAsyncResult  result)

Ends an asynchronous operation to delete monitored items.

Parameters
resultThe object returned from the BeginDeleteMonitoredItems method.
Returns
A list of StatusCodes that indicate for each monitored item whether the DeleteMonitoredItem operation has been successful.
void UnifiedAutomation.UaClient.Subscription.EndModify ( IAsyncResult  result)

Completes an asynchronous operation to modify a subscription.

Parameters
resultThe object returned from the BeginModify method.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.EndModifyMonitoredItems ( IAsyncResult  result)

Ends an asynchronous operation to modify monitored items.

Parameters
resultThe object returned from the BeginModifyMonitoredItems method.
Returns
A list of StatusCodes that indicate for each monitored item whether the ModifyMonitoredItem operation has been successful.
NotificationMessage UnifiedAutomation.UaClient.Subscription.EndRepublish ( IAsyncResult  result)

Ends an asynchronous operation to republish lost notification messages.

Parameters
resultThe object returned from the BeginRepublish method.
Returns
The notification message returned by the server.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.EndSetMonitoringMode ( IAsyncResult  result)

Ends an asynchronous operation to set the monitoring mode for monitored items.

Parameters
resultThe object returned from the BeginSetMonitoringMode method.
Returns
A list of StatusCodes that indicate for each monitored item whether the SetMonitoringMode operation has been successful.
SetTriggeringResult UnifiedAutomation.UaClient.Subscription.EndSetTriggering ( IAsyncResult  result)

Ends a request to change the triggering for a monitored item.

Parameters
resultThe object used to manage the state of the asynchronous operation.
Returns
The results for each operation to add or remove a link.
virtual void UnifiedAutomation.UaClient.Subscription.Load ( IDecoder  decoder)
virtual

Initializes the Subscription using the specified decoder.

Parameters
decoderThe decoder used when initializing the subscription.
virtual void UnifiedAutomation.UaClient.Subscription.LoadAll ( BinaryDecoder  decoder)
virtual

Initializes the Subscription using the specified decoder including the revised parameters by the server and the MonitoredItems.

EXPERIMENTAL: This method is a prototype for a not released feature. The format of the encoded subscription can change in future versions of the sdk. This method cannot be called after Subscription.Create or Session.TransferSubscriptions is called.

Parameters
decoderThe decoder used when initializing the subscription.

It is recommended to use the MessageContext of the current Session to create the decoder. The Session must be connected when calling LoadAll.

void UnifiedAutomation.UaClient.Subscription.Modify ( )

Modifies a subscription.

void UnifiedAutomation.UaClient.Subscription.Modify ( RequestSettings  settings)

Modifies a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Task UnifiedAutomation.UaClient.Subscription.ModifyAsync ( RequestSettings  settings)

Asynchronously modifies a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes when the subscription was modified.
Note
This method is not available on .NET framework versions prior 4.5.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItems ( IList< MonitoredItem monitoredItems)

Modifies monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
Returns
A list of StatusCodes that indicate for each monitored item whether the ModifyMonitoredItem operation has been successful.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Modifies monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the ModifyMonitoredItem operation has been successful.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItems ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings 
)

Modifies monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
timestampsToReturnOPC UA defines two timestamps, the source and the server timestamp. This parameter allows the client to define which timestamps the server should return with the value.
The source timestamp is only available for Value Attributes. The source timestamp is used to reflect the timestamp that was applied to a Variable value by the data source. It should indicate the last change of the value or status code. The source timestamp must be always generated by the same physical clock. This timestamp type was added for OPC UA to cover the use case to get the timestamp of the last value change which is different than the server timestamp definition.
The server timestamp is used to reflect the time that the server received a Variable value or knew it to be accurate if the changes are reported by exception and the connection to the data source is operating. This is the behavior expected by Classic OPC
Possible values are
  • TimestampsToReturn.Source
  • TimestampsToReturn.Server
  • TimestampsToReturn.Both
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the ModifyMonitoredItem operation has been successful.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItemsAsync ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Asynchronous call to modify monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItemsAsync ( IList< MonitoredItem monitoredItems,
TimestampsToReturn  timestampsToReturn,
RequestSettings  settings 
)

Asynchronous call to modify monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
timestampsToReturnOPC UA defines two timestamps, the source and the server timestamp. This parameter allows the client to define which timestamps the server should return with the value.
The source timestamp is only available for Value Attributes. The source timestamp is used to reflect the timestamp that was applied to a Variable value by the data source. It should indicate the last change of the value or status code. The source timestamp must be always generated by the same physical clock. This timestamp type was added for OPC UA to cover the use case to get the timestamp of the last value change which is different than the server timestamp definition.
The server timestamp is used to reflect the time that the server received a Variable value or knew it to be accurate if the changes are reported by exception and the connection to the data source is operating. This is the behavior expected by Classic OPC
Possible values are
  • TimestampsToReturn.Source
  • TimestampsToReturn.Server
  • TimestampsToReturn.Both
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the CreateMonitoredItem operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
void UnifiedAutomation.UaClient.Subscription.Recreate ( RequestSettings  settings)

Recreates the subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
void UnifiedAutomation.UaClient.Subscription.Recreate ( NamespaceTable  oldNamespaceUris,
RequestSettings  settings 
)

Recreates the subscription.

Parameters
oldNamespaceUrisThe current NamespaceTable that has been used when the MonitoredItems of the Subscription have been created. If not null and not equal to the current NamespaceTable of the Session, the NodeIds of the MonitoredItems are mapped to use the current NamespaceTable.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
NotificationMessage UnifiedAutomation.UaClient.Subscription.Republish ( uint  retransmitSequenceNumber)

Republish call to get lost notification messages.

Parameters
retransmitSequenceNumberThe sequence number of a notification message to be republished.
Returns
The notification message returned by the server.
NotificationMessage UnifiedAutomation.UaClient.Subscription.Republish ( uint  retransmitSequenceNumber,
RequestSettings  settings 
)

Republish call to get lost notification messages.

Parameters
retransmitSequenceNumberThe sequence number of a notification message to be republished.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
The notification message returned by the server.
Task<NotificationMessage> UnifiedAutomation.UaClient.Subscription.RepublishAsync ( uint  retransmitSequenceNumber,
RequestSettings  settings 
)

Asynchronous republish call to get lost notification messages.

Parameters
retransmitSequenceNumberThe sequence number of a notification message to be republished.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes with the notification message returned by the server.
Note
This method is not available on .NET framework versions prior 4.5.
virtual void UnifiedAutomation.UaClient.Subscription.Save ( IEncoder  encoder)
virtual

Saves the Subscription using the specified encoder.

Parameters
encoderThe encoder to save the subscription with.
virtual void UnifiedAutomation.UaClient.Subscription.SaveAll ( BinaryEncoder  encoder)
virtual

Saves the Subscription using the specified encoder including the revised parameters by the server and the MonitoredItems

EXPERIMENTAL: This method is a prototype for a not released feature. The format of the encoded subscription can change in future versions of the sdk. The use case for this method is to save a subscription before shutting down the client application. The subscription can be re-initialized and used for Session.TransferSubscriptions.

Parameters
encoderThe encoder to save the subscription with.

It is recommended to use the MessageContext of the current Session to create the encoder. The Session must be connected when calling SaveAll.

List<StatusCode> UnifiedAutomation.UaClient.Subscription.SetMonitoringMode ( MonitoringMode  monitoringMode,
IList< MonitoredItem monitoredItems 
)

Sets the monitoring mode for a list of monitored items.

Parameters
monitoringModeThe new monitoring mode. Possible values are Disabled, Sampling, and Reporting.
monitoredItemsA list of monitored items.
Returns
List<StatusCode> UnifiedAutomation.UaClient.Subscription.SetMonitoringMode ( MonitoringMode  monitoringMode,
IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Sets the monitoring mode for a list of monitored items.

Parameters
monitoringModeThe new monitoring mode. Possible values are Disabled, Sampling, and Reporting.
monitoredItemsA list of monitored items.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
A list of StatusCodes that indicate for each monitored item whether the SetMonitoringMode operation has been successful.
Task<List<StatusCode> > UnifiedAutomation.UaClient.Subscription.SetMonitoringModeAsync ( MonitoringMode  monitoringMode,
IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)

Asynchronous call to set the monitoring mode for a list of monitored items.

Parameters
monitoringModeThe new monitoring mode. Possible values are Disabled, Sampling, and Reporting.
monitoredItemsA list of monitored items.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
Returns
An asynchronous task that completes with a list of StatusCodes that indicate for each monitored item whether the SetMonitoringMode operation has been successful.
Note
This method is not available on .NET framework versions prior 4.5.
SetTriggeringResult UnifiedAutomation.UaClient.Subscription.SetTriggering ( MonitoredItem  triggeringItem,
IList< MonitoredItem linksToAdd,
IList< MonitoredItem linksToRemove,
RequestSettings  settings 
)

Change the triggering for a monitored item.

This method allows to specify items that are reported only when some other item (the triggering item) triggers. This is done by creating links between the triggered items and the items to report.The monitoring mode of the items to report is set to sampling-only so that it will sample and queue Notifications without reporting them.

Parameters
triggeringItemThe monitored item which triggers other monitored items when it reports. This item shall belong to this Subscription.
linksToAddThe list of monitored items which report when the trigger changes. These MonitoredItems shall belong to this Subscription. The MonitoringMode of these MonitoredItems should be MonitoringMode.Sampling.
linksToRemoveThe list of monitored items previously added which should no longer report when the trigger changes.
settingsThe settings.
Returns
The results for each operation to add or remove a link.
Task<SetTriggeringResult> UnifiedAutomation.UaClient.Subscription.SetTriggeringAsync ( MonitoredItem  triggeringItem,
IList< MonitoredItem linksToAdd,
IList< MonitoredItem linksToRemove,
RequestSettings  settings 
)

Begins a request to change the triggering for a monitored item.

This method allows to specify items that are reported only when some other item (the triggering item) triggers. This is done by creating links between the triggered items and the items to report.The monitoring mode of the items to report is set to sampling-only so that it will sample and queue Notifications without reporting them.

Parameters
triggeringItemThe monitored item which triggers other monitored items when it reports. This item shall belong to this Subscription.
linksToAddThe list of monitored items which report when the trigger changes. These MonitoredItems shall belong to this Subscription. The MonitoringMode of these MonitoredItems should be MonitoringMode.Sampling.
linksToRemoveThe list of monitored items previously added which should no longer report when the trigger changes.
settingsThe settings.
Returns
An asynchronous task that completes with the results for each operation to add or remove a link.
Note
This method is not available on .NET framework versions prior 4.5.
void UnifiedAutomation.UaClient.Subscription.Transfer ( uint  subscriptionId,
List< uint >  availableSequenceNumbers,
RequestSettings  settings 
)

Transfers the subscription with the specified subscription id.

The application is responsible for ensuring that MonitoredItems stored locally match the MonitoredItems that the Server knows about.

Parameters
subscriptionIdThe SubscriptionId assigned by the Server.
availableSequenceNumbersA list of sequence number ranges that identify NotificationMessages that are in the Subscription’s retransmission queue. This parameter is null if the transfer of the Subscription failed.
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.

Property Documentation

SubscriptionConnectionStatus UnifiedAutomation.UaClient.Subscription.ConnectionStatus
get

Gets the connection status for the subscription.

double UnifiedAutomation.UaClient.Subscription.CurrentLifetime
getset

Gets the lifetime of the Subscription (in milliseconds) currently set on the server.

See also
Lifetime
double UnifiedAutomation.UaClient.Subscription.CurrentMaxKeepAliveTime
getset

Gets the maximum keep alive time (in milliseconds) currently set on the server.

See also
MaxKeepAliveTime
uint UnifiedAutomation.UaClient.Subscription.CurrentMaxNotificationsPerPublish
getset

Gets the maximum number of notifications per publish currently set on the server.

See also
MaxNotificationsPerPublish
byte UnifiedAutomation.UaClient.Subscription.CurrentPriority
getset

Gets the priority of the subscription currently set on the server.

See also
Priority
bool UnifiedAutomation.UaClient.Subscription.CurrentPublishingEnabled
getset

Gets a value indicating whether publishing is currently enabled on the server.

true if publishing is currently enabled; otherwise, false.

See also
PublishingEnabled
double UnifiedAutomation.UaClient.Subscription.CurrentPublishingInterval
getset

Gets the publishing interval (in milliseconds) currently set on the server.

See also
PublishingInterval
RequestSettings UnifiedAutomation.UaClient.Subscription.DefaultRequestSettings
getset

Gets or sets the default request settings for the subscription.

The default request settings include a timeout, diagnostic settings, request id, and maximum number of operations per request.

TimestampsToReturn UnifiedAutomation.UaClient.Subscription.DefaultTimestampsToReturn
getset

Gets or sets the default timestamp to return.

double UnifiedAutomation.UaClient.Subscription.Lifetime
getset

Gets or sets the lifetime (in milliseconds).

The Lifetime of a Subscription specifies when the Server will close a Subscription due to a lack of Publish requests. This can occur because the Client stops sending Publish requests or because higher priority Subscriptions are consuming all of the available Publish requests. When a Subscription expires, a StatusNotification is returned in the next Publish response to inform the Client that the Subscription is gone.

For convenience this property is defined as time interval in milliseconds. It is internally converted to the UA defined parameter requestedLifetimeCount.

The requested Lifetime may be overridden by the Server. Clients must check the CurrentLifetime property after creating or modifying a Subscription to see the value that the Server will actually use.

See also
CurrentLifetime
double UnifiedAutomation.UaClient.Subscription.MaxKeepAliveTime
getset

Gets or sets the maximum keep alive time (in milliseconds).

MaxKeepAliveTime specifies the maximum time between Publish responses for a Subscription. If no notifications are available, an empty Publish response is returned in order to tell the Client that the Subscription is still alive.

For convenience this property is defined as time interval in milliseconds. It is internally converted to the UA defined parameter requestedMaxKeepAliveCount.

The requested MaxKeepAliveTime may be overridden by the Server. Clients must check the CurrentMaxKeepAliveTime property after creating or modifying a Subscription to see the value that the Server will actually use.

See also
CurrentMaxKeepAliveTime
uint UnifiedAutomation.UaClient.Subscription.MaxNotificationsPerPublish
getset

Gets or sets the maximum number of notifications per publish.

MaxNotificationsPerPublish specifies the maximum number of notifications that the Client wishes to receive in a single Publish response. A value of zero indicates that there is no limit.

The server may send fewer notifications in one message if its own limit is lower.

See also
CurrentMaxNotificationsPerPublish
MonitoredItem [] UnifiedAutomation.UaClient.Subscription.MonitoredItems
get

Gets the monitored items in the subscription.

byte UnifiedAutomation.UaClient.Subscription.Priority
getset

Gets or sets the priority of the subscription.

This setting defines the priority of the subscription relative to other subscriptions created by the client.

A Client that does not require special priority settings should set this value to zero.

See also
CurrentPriority
bool UnifiedAutomation.UaClient.Subscription.PublishingEnabled
getset

Gets or sets a value indicating whether publishing is enabled.

true if publishing is enabled; otherwise, false.

See also
CurrentPublishingEnabled
double UnifiedAutomation.UaClient.Subscription.PublishingInterval
getset

Gets or sets the publishing interval (in milliseconds).

The Publishing Interval specifies the minimum time between Publish responses for a Subscription. Any notifications are buffered by the Server until the Publishing Interval expires. The Server will continue to buffer notifications if no Publish request is available until the Lifetime expires. At this point, the buffered notifications are discarded. Note that the time between Publish responses can be less than the Publishing Interval if the number of notifications exceeds MaxNotificationsPerRequest. However, in this scenario multiple Publish responses are sent as a batch followed by a gap until the PublishingInterval expires again.

The requested PublishingInterval may be overridden by the Server. Clients must check the CurrentPublishingInterval property after creating or modifying a Subscription to see the value that the Server will actually use.

See also
CurrentPublishingInterval
Session UnifiedAutomation.UaClient.Subscription.Session
get

Gets the session the subscription is associated with.

uint UnifiedAutomation.UaClient.Subscription.SubscriptionId
getset

Gets the subscription id.

This property reflects the server-assigned identifier for the subscription. It is unique for the entire server in order to allow the subscription to be transferred to another Session.

See also
ChangeSession(Session)
Object UnifiedAutomation.UaClient.Subscription.UserData
getset

Gets or sets the user data.

Event Documentation

DataChangedEventHandler UnifiedAutomation.UaClient.Subscription.DataChanged

Occurs when any subscribed data value has changed.

This event handler provides the data notification for a subscription.

Data changes may arrive for monitored items before the creation of the monitored items is completed and the CreateMonitoredItems call returns. The client application must be prepared for that and ClientHandles passed in to CreateMonitoredItems must be valid and usable before CreateMonitoredItems returns.

Data changes may also arrive after monitored items are deleted, sampling is turned off, or after the publishing is disabled.

This event handler is normally not called faster than configured in PublishingInterval but this is controlled by the OPC UA Server and not by the client SDK. If the number of notifications in one publishing interval exceeds the setting MaxNotificationsPerPublish, the OPC UA Server will send more than one publish response and this DataChanged may be called more than one time in the PublishingInterval.

If no new data is available in a PublishingInterval, no DataChanged is called and a NotificationMessageReceived event handler with a null data field may be called depending on the property MaxKeepAliveCount.

The DataChanged is called from a worker thread but it should not be blocked by the application since this will block other callbacks like NewEvents contained in the same publish response and also blocks more publish responses received for the same Subscription object.

MissingSequenceNumberEventHandler UnifiedAutomation.UaClient.Subscription.MissingSequenceNumber

Occurs when a sequence number is missing.

The client SDK monitors the sequence numbers of the received data and event notifications and reports gaps in the sequence numbers using this event handler. The client can use the Republish method to request the missing notifications.

The MissingSequenceNumber is called from a worker thread but it should not be blocked by the application since this will block other event handler like DataChanged contained in the same Publish response and also blocks more Publish responses received for the same Subscription object.

NewEventsEventHandler UnifiedAutomation.UaClient.Subscription.NewEvents

Occurs when any new event has arrived.

This event handler provides the event notification for a subscription.

New events may arrive for monitored items before the creation of the monitored items is completed and the CreateMonitoredItems call returns. The client application must be prepared for that and ClientHandles passed in to CreateMonitoredItems must be valid and usable before CreateMonitoredItems returns.

New events may also arrive after monitored items are deleted, sampling is turned off, or after the publishing is disabled.

This event handler is normally not called faster than configured in PublishingInterval but this is controlled by the OPC UA Server and not by the client SDK. If the number of notifications in one publishing interval exceeds the setting MaxNotificationsPerPublish, the OPC UA Server will send more than one publish response and this NewEvents may be called more than one time in the PublishingInterval.

If no new events are available in a PublishingInterval, no NewEvents is called and a NotificationMessageReceived event handler with a null data field may be called depending on the property MaxKeepAliveCount.

The NewEvents is called from a worker thread but it should not be blocked by the application since this will block other callbacks like DataChanged contained in the same publish response and also blocks more publish responses received for the same Subscription object.

NotificationMessageReceivedEventHandler UnifiedAutomation.UaClient.Subscription.NotificationMessageReceived

Occurs when a new notification message arrives.

This event handler provides all notifications for a subscription.

With the this event handler you get access to DataChanged and NewEvents plus control over the Publish sequence number handling. This is mainly necessary if you implement a redundant client and you need access to the sequence numbers and the sequence number confirmation.

Notification messages may arrive for monitored items before the creation of the monitored items is completed and the CreateMonitoredItems call returns. The client application must be prepared for that and ClientHandles passed in to CreateMonitoredItems must be valid and usable before CreateMonitoredItems returns.

Notification messages may also arrive after monitored items are deleted, sampling is turned off, or after the publishing is disabled.

This event handler is normally not called faster than configured in PublishingInterval but this is controlled by the OPC UA Server and not by the client SDK. If the number of notifications in one publishing interval exceeds the setting MaxNotificationsPerPublish, the OPC UA Server will send more than one publish response and this NotificationMessageReceived may be called more than one time in the PublishingInterval.

If no data changes or new events are available in a PublishingInterval, this event handler with a null data field may be called depending on the property MaxKeepAliveCount.

The NotificationMessageReceived is called from a worker thread but it should not be blocked by the application since this will block other callbacks like DataChanged contained in the same publish response and also blocks more publish responses received for the same Subscription object.

SubscriptionRecreatedEventHandler UnifiedAutomation.UaClient.Subscription.Recreated

Occurs when a Subscription is automatically recreated after a successful reconnect.

SubscriptionStatusChangedEventHandler UnifiedAutomation.UaClient.Subscription.StatusChanged

Occurs when the status of subscription changes.

This event handler informs the client if the status of a subscription changes. This can happen after a connection error that lasted longer than the lifetime of the subscription. The lifetime is calculated from PublishingInterval x MaxKeepAliveCount x LifetimeCount. A client must create a new subscription to continue data or event monitoring if this event handler indicates a bad status for the subscription. Subscription.Delete should be called even if the subscription is no longer valid in the server to dispose the client side subscription object.


The documentation for this class was generated from the following files: