UA Bundle SDK .NET  2.2.3.276
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Groups Pages
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...
 
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...
 
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...
 
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...
 
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...
 
IAsyncResult BeginModifyMonitoredItems (IList< MonitoredItem > monitoredItems, 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 ansynchronous operation to set the monitoring mode for moniored items. 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...
 

Properties

Session Session [get]
 Gets the session the subscription is associated with. More...
 
SubscriptionConnectionStatus ConnectionStatus [get, set]
 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...
 

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 Subcription Overview and OPC UA Subscription Concept for a more general description.

Constructor & Destructor Documentation

UnifiedAutomation.UaClient.Subscription.Subscription ( Session  session)
inline

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 
)
inline

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 
)
inline

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.BeginDelete ( RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)
inline

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 
)
inline

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 
)
inline

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 
)
inline

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.BeginRepublish ( uint  retransmitSequenceNumber,
RequestSettings  settings,
AsyncCallback  callback,
object  userData 
)
inline

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 
)
inline

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.
void UnifiedAutomation.UaClient.Subscription.Create ( )
inline

Creates a new subscription on the server.

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

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.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.CreateMonitoredItems ( IList< MonitoredItem monitoredItems)
inline

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
List<StatusCode> UnifiedAutomation.UaClient.Subscription.CreateMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)
inline

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
void UnifiedAutomation.UaClient.Subscription.Delete ( )
inline

Deletes a subscription.

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

Deletes a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.DeleteMonitoredItems ( IList< MonitoredItem monitoredItems)
inline

Deletes monitored items.

Parameters
monitoredItemsA list of monitored items to delete.
Returns
List<StatusCode> UnifiedAutomation.UaClient.Subscription.DeleteMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)
inline

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
void UnifiedAutomation.UaClient.Subscription.EndCreate ( IAsyncResult  result)
inline

Completes an asynchronous operation to create a subscription.

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

Ends an asynchronous operation to create monitored items.

Parameters
resultThe object returned from the BeginCreateMonitoredItems method.
Returns
void UnifiedAutomation.UaClient.Subscription.EndDelete ( IAsyncResult  result)
inline

Completes an asynchronous operation to delete a subscription.

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

Ends an asynchronous operation to delete monitored items.

Parameters
resultThe object returned from the BeginDeleteMonitoredItems method.
Returns
void UnifiedAutomation.UaClient.Subscription.EndModify ( IAsyncResult  result)
inline

Completes an asynchronous operation to modify a subscription.

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

Ends an asynchronous operation to modify monitored items.

Parameters
resultThe object returned from the BeginModifyMonitoredItems method.
Returns
NotificationMessage UnifiedAutomation.UaClient.Subscription.EndRepublish ( IAsyncResult  result)
inline

Ends an asynchronous operation to republish lost notification messages.

Parameters
resultThe object returned from the BeginRepublish method.
Returns
List<StatusCode> UnifiedAutomation.UaClient.Subscription.EndSetMonitoringMode ( IAsyncResult  result)
inline

Ends an ansynchronous operation to set the monitoring mode for moniored items.

Parameters
resultThe object returned from the BeginSetMonitoringMode method.
Returns
virtual void UnifiedAutomation.UaClient.Subscription.Load ( IDecoder  decoder)
inlinevirtual

Initializes the Subscription using the specified decoder.

Parameters
decoderThe decoder used when initializing the subscription.
void UnifiedAutomation.UaClient.Subscription.Modify ( )
inline

Modifies a subscription.

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

Modifies a subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItems ( IList< MonitoredItem monitoredItems)
inline

Modifies monitored items.

Parameters
monitoredItemsA list of monitored items to modify.
Returns
List<StatusCode> UnifiedAutomation.UaClient.Subscription.ModifyMonitoredItems ( IList< MonitoredItem monitoredItems,
RequestSettings  settings 
)
inline

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
void UnifiedAutomation.UaClient.Subscription.Recreate ( RequestSettings  settings)
inline

Recreates the subscription.

Parameters
settingsThe general settings for the request. If null, the default settings from the property DefaultRequestSettings are used.
NotificationMessage UnifiedAutomation.UaClient.Subscription.Republish ( uint  retransmitSequenceNumber)
inline

Republish call to get lost notification messages.

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

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
virtual void UnifiedAutomation.UaClient.Subscription.Save ( IEncoder  encoder)
inlinevirtual

Saves the Subscription using the specified encoder.

Parameters
encoderThe encoder to save the subscription with.
List<StatusCode> UnifiedAutomation.UaClient.Subscription.SetMonitoringMode ( MonitoringMode  monitoringMode,
IList< MonitoredItem monitoredItems 
)
inline

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 
)
inline

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
void UnifiedAutomation.UaClient.Subscription.Transfer ( uint  subscriptionId,
List< uint >  availableSequenceNumbers,
RequestSettings  settings 
)
inline

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
getset

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
Transfer
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.

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 file: