Skip to content

Reference

OpcSubscription Class

Provides mechanisms to monitor a set of attributes (= node data) and (node-related) events using notifications being reported from the server to the client.

Reference

OpcSubscription Class ​

Namespace
Opc.UaFx.Client
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Members
OpcSubscription Members
Also in
Opc.UaFx.Client

Provides mechanisms to monitor a set of attributes (= node data) and (node-related) events using notifications being reported from the server to the client.

Syntax ​

csharp
public class OpcSubscription
vbnet
Public Class OpcSubscription

Inheritance ​

Object → OpcSubscription

Remarks ​

When a subscription is created, the first message is sent at the end of the first publishing cycle to inform the client that the subscription is operational. Another message is sent if there are notifications ready to be reported. If there are none, a keep-alive message is sent instead that contains a sequence number of one, indicating that the first notification has not yet been sent. This is the only time a keep-alive message is sent without waiting for the maximum keep-alive count to be reached.

Properties ​

NameDescription
Clientsince v2.15Gets the OpcClient used to setup this OpcSubscription.
CurrentKeepAliveCountGets the actual keep-alive count used by the server for this OpcSubscription which has been negotiated by the server against the KeepAliveCount requested to meet its own constraints.
CurrentLifetimeCountGets the actual lifetime count used by the server for this OpcSubscription which has been negotiated by the server against the LifetimeCount requested to meet its own constraints.
CurrentPriorityGets the actual relative priority of the subscription used to priorize notifications being send then more than one subscription is to be notified.
CurrentPublishingIntervalGets the actual publishing interval used by the server for this OpcSubscription which has been negotiated by the server against the PublishingInterval requested to meet its own constraints.
CurrentPublishingIsEnabledGets the actual value indicating whether publishing is enabled by the server for this OpcSubscription which has been created and validated by the server against its own constraints.
DisplayNameGets or sets the name of the OpcSubscription used just for display purpose in the client application.
HasPendingChangesGets a value indicating whether there exists any pending change on the subscription which needs to be applied to take effect (ApplyChanges).
IdGets the server-assigned unique identifier for this OpcSubscription.
IsCreatedGets a value indicating whether this OpcSubscription has been created on the server.
IsPublishingGets a value indicating whether this OpcSubscription is receiving notifications.
KeepAliveCountGets or sets a value which defines the requested number of times the publishing timer have to expire without any notification being sent before the server have to send a keep-alive message to the client.
LastNotificationGets the last notification received from the server.
LastNotificationTimeGets the time the last notification which has been received from the server.
LifetimeCountGets or sets a value which defines the requested number of times the publishing timer have to expire without any publish request before the server have to delete this OpcSubscription.
MaxMessageCountGets or sets the maximum number of notifications to keep in the cache.
MaxNotificationsPerPublishGets or sets a value which defines the maximum number of notifications that the client wants to receive in a single publish response.
MinLifetimeIntervalGets or sets a value which defines the minimum lifetime interval to apply in respect of the PublishingInterval and the LifetimeCount configured.
MonitoredItemsGets a read-only collection of OpcMonitoredItem instances associated with this OpcSubscription.
NotificationsGets a sequence of OpcNotification instances received from the server.
PriorityGets or sets a value which defines the relative priority of the subscription used to priorize notifications being send then more than one subscription is to be notified.
PublishingIntervalGets or sets the requested number of milliseconds of the interval within the server have to send cyclic notifications to the client.
PublishingIsEnabledGets or sets a value indicating whether publishing is enabled for this OpcSubscription.
PublishTimeGets the time the last notification was published from the server.
ReceivedDataChangeCallbackGets or sets the callback used to process data changes of the monitored items associated with this OpcSubscription.
ReceivedEventCallbackGets or sets the callback used to process events of the monitored items associated with this OpcSubscription.
SequenceNumberGets the sequence number of the last notification which has been received from the server.
TagGets or sets the object that contains additional user data about the subscription.
TimestampsToReturnGets or sets the timestamps the server shall transmit for each monitored item.
UseMonitoredItemDataCacheGets or sets a value indicating whether this OpcSubscription shall forward notifications received from the server to monitored item individual caches.

Methods ​

NameDescription
AddMonitoredItem15 overloadsAdds the monitored item specified by item to this OpcSubscription.
ApplyChangesApplies any changes made on the current OpcSubscription or on one of its MonitoredItems using the according services of the server connected to.
ChangeMonitoringMode3 overloadsChanges the monitoring mode of all MonitoredItems.
GetMonitoredItemRetrieves the OpcMonitoredItem the dataChange specified belongs to.
OnChangedprotected · virtualRaises the Changed event of the OpcSubscription.
OnDataChangeReceivedprotected · virtualRaises the DataChangeReceived event of the OpcSubscription.
OnEventReceivedprotected · virtualRaises the EventReceived event of the OpcSubscription.
OnIsPublishingChangedprotected · virtualRaises the IsPublishingChanged event of the OpcSubscription.
OnNotificationFailedprotected · virtual · since v2.57Raises the NotificationFailed event of the OpcSubscription.
OnNotificationReceivedprotected · virtualRaises the NotificationReceived event of the OpcSubscription.
RefreshConditionsForces the server to refresh all current conditions to synchronize the client with the server.
RemoveMonitoredItem3 overloadsRemoves the monitored item specified by item from the MonitoredItems of this OpcSubscription.
ResendDatasince v2.51Notifies the server to resend the current values of the MonitoredItems monitoring data changes where the MonitoringMode is equals to Reporting.
StartPublishingEnables notifications being send from the server to the client for this OpcSubscription.
StopPublishingDisables notifications being send from the server to the client for this OpcSubscription.
ToStringoverrideReturns a string that represents the current OpcSubscription.
UnsubscribeDeletes this OpcSubscription and all its MonitoredItems.

Events ​

NameDescription
ChangedOccurs then a monitored is added, modified, deleted or changes on the OpcSubscription were applied.
DataChangeReceivedOccurs then a monitored item receives an event notification which is not handled by an OpcDataChangeReceivedEventHandler on its DataChangeReceived event.
EventReceivedOccurs then a monitored item receives an event notification which is not handled by an OpcEventReceivedEventHandler on its EventReceived event.
IsPublishingChangedOccurs then the IsPublishing property has changed.
NotificationFailedsince v2.57Occurs then a notification message for this OpcSubscription failed to be received, so that its data changes and events do not reach the monitored items.
NotificationReceivedOccurs then a OpcNotification for this OpcSubscription has been received by the session which owns this OpcSubscription.

Applies to ​

PackageVersions
Opc.UaFx.Advancedv2.5–v2.59