Reference
OpcSubscription Members
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 Members
- Type
- OpcSubscription
- Namespace
- Opc.UaFx.Client
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
- Also in
- Opc.UaFx.Client
Properties
Client
Gets the OpcClient used to setup this OpcSubscription.
public OpcClient Client { get; }Public ReadOnly Property Client As OpcClientProperty value
An instance of the OpcClient class used to setup this OpcSubscription.
CurrentKeepAliveCount
Gets 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.
public long CurrentKeepAliveCount { get; }Public ReadOnly Property CurrentKeepAliveCount As LongProperty value
The negoiated and actual KeepAliveCount used.
Remarks
The server negotiates the value up or down to meet its own constraints.
CurrentLifetimeCount
Gets 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.
public long CurrentLifetimeCount { get; }Public ReadOnly Property CurrentLifetimeCount As LongProperty value
The negoiated and actual LifetimeCount used.
Remarks
The server negotiates the value up or down to meet its own constraints.
CurrentPriority
Gets the actual relative priority of the subscription used to priorize notifications being send then more than one subscription is to be notified.
public int CurrentPriority { get; }Public ReadOnly Property CurrentPriority As IntegerProperty value
The actual Priority used.
Remarks
For more details see Priority.
CurrentPublishingInterval
Gets 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.
public double CurrentPublishingInterval { get; }Public ReadOnly Property CurrentPublishingInterval As DoubleProperty value
The negoiated and actual PublishingInterval used.
Remarks
The server negotiates the value up or down to meet its own constraints.
CurrentPublishingIsEnabled
Gets 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.
public bool CurrentPublishingIsEnabled { get; }Public ReadOnly Property CurrentPublishingIsEnabled As BooleanProperty value
The value true if the server has enabled publishing for this OpcSubscription; otherwise the value false.
DisplayName
Gets or sets the name of the OpcSubscription used just for display purpose in the client application.
public string DisplayName { get; set; }Public Property DisplayName As StringProperty value
The name of the OpcSubscription used just for display purpose in the client application.
HasPendingChanges
Gets a value indicating whether there exists any pending change on the subscription which needs to be applied to take effect (ApplyChanges).
public bool HasPendingChanges { get; }Public ReadOnly Property HasPendingChanges As BooleanProperty value
The value true if there is at least one change not yet applied; otherwise the value false.
Id
Gets the server-assigned unique identifier for this OpcSubscription.
public long Id { get; }Public ReadOnly Property Id As LongProperty value
The server-assigned unique identifier for this OpcSubscription.
Remarks
The identifier shall be unique for the entire server, not just for the Session, in order to allow the OpcSubscription to be transferred to another session.
IsCreated
Gets a value indicating whether this OpcSubscription has been created on the server.
public bool IsCreated { get; }Public ReadOnly Property IsCreated As BooleanProperty value
The value true if the OpcSubscription has been created on the server; otherwise the value false.
Remarks
When the client reconnects with a new session, it creates its subscriptions again. A subscription the server rejects then is not created, while the client is connected again with the others; it is created again with the next new session.
IsPublishing
Gets a value indicating whether this OpcSubscription is receiving notifications.
public bool IsPublishing { get; }Public ReadOnly Property IsPublishing As BooleanProperty value
The value true if the OpcSubscription is receiving notifications; otherwise the value false.
KeepAliveCount
Gets 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.
public long KeepAliveCount { get; set; }Public Property KeepAliveCount As LongProperty value
A value of zero indicates that the server have to revise the smallest supported keep-alive count. The default value of this property is 10.
The value of this property configures the keep-alive counter that counts the number of consecutive publishing cycles in which there have been no notifications to report to the client. When the maximum keep-alive count is reached, a publish request is de-queued and used to return a keep-alive message. This keep-alive message informs the client that the subscription is still active. The maximum keep-alive count may be subsequently modified. If there are no publish requests queued, the server waits for the next one to be received and sends the keep-alive immediately without waiting for the next publishing cycle.
The value of the underlying property is an uint which is covered using a long to assure CLS compliance. In fact this restricts the value range of this property to MinValue and MaxValue.
Remarks
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
LastNotification
Gets the last notification received from the server.
public OpcNotification LastNotification { get; }Public ReadOnly Property LastNotification As OpcNotificationProperty value
An instance of the OpcNotification class which represents the last notfication received from the server or a null reference (Nothing in Visual Basic) if the OpcSubscription has not yet received a notification from the server or MaxMessageCount is less or equals zero.
LastNotificationTime
Gets the time the last notification which has been received from the server.
public DateTime? LastNotificationTime { get; }Public ReadOnly Property LastNotificationTime As Date?Property value
A DateTime identifying the instant of time the last notification which has been received from the server or a null reference (Nothing in Visual Basic) if the OpcSubscription has not yet received a notification from the server.
LifetimeCount
Gets 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.
public long LifetimeCount { get; set; }Public Property LifetimeCount As LongProperty value
The number of times the publishing timer have to expire without any publish request. A recommended value is at least a minimum of three times of the KeepAliveCount. The default value of this property is 100.
Remarks
The value of the underlying property is an uint which is covered using a long to assure CLS compliance. In fact this restricts the value range of this property to MinValue and MaxValue.
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
MaxMessageCount
Gets or sets the maximum number of notifications to keep in the cache.
public int MaxMessageCount { get; set; }Public Property MaxMessageCount As IntegerProperty value
The maximum number of notification to keep in the cache. The default value of this property is 10.
MaxNotificationsPerPublish
Gets or sets a value which defines the maximum number of notifications that the client wants to receive in a single publish response.
public long MaxNotificationsPerPublish { get; set; }Public Property MaxNotificationsPerPublish As LongProperty value
The maximum number of notifications that the client wants to receive in a single publish response. The number of notifications per publish is the sum of MonitoredItems in a data change related notification and the number of events in an event notification. The default value of this property is 1000.
Remarks
A value of zero indicates that there is no limit.
The value of the underlying property is an uint which is covered using a long to assure CLS compliance. In fact this restricts the value range of this property to MinValue and MaxValue.
MinLifetimeInterval
Gets or sets a value which defines the minimum lifetime interval to apply in respect of the PublishingInterval and the LifetimeCount configured.
public long MinLifetimeInterval { get; set; }Public Property MinLifetimeInterval As LongProperty value
The interval which should be a multiple of the PublishingInterval to assure that the LifetimeCount requested is sensible enough to get covered within the PublishingInterval.
MonitoredItems
Gets a read-only collection of OpcMonitoredItem instances associated with this OpcSubscription.
public OpcMonitoredItemReadOnlyCollection MonitoredItems { get; }Public ReadOnly Property MonitoredItems As OpcMonitoredItemReadOnlyCollectionProperty value
OpcMonitoredItemReadOnlyCollection
An instance of the OpcMonitoredItemReadOnlyCollection class.
Remarks
Use the monitored item related methods of this OpcSubscription to manipulate the items contained in the collection offered by this property.
Notifications
Gets a sequence of OpcNotification instances received from the server.
public IEnumerable<OpcNotification> Notifications { get; }Public ReadOnly Property Notifications As IEnumerable(Of OpcNotification)Property value
A sequence of OpcNotification instances representing the notifications received from the server. The sequence is empty if the OpcSubscription has not yet received a notification from the server.
Remarks
The number of instances in the sequence is limited to the maximum number of messages in the cache (see MaxMessageCount).
Priority
Gets 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.
public int Priority { get; set; }Public Property Priority As IntegerProperty value
The relative priority of the subscription to notify.
Remarks
In case of subscriptions with equal priority the server shall send the notifications in a round-robin fashion. A client that does not require special priority settings should set this value to zero.
The value of the underlying property is a byte which is covered using an int to assure an even API level. In fact this restricts the value range of this property to MinValue and MaxValue.
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
PublishingInterval
Gets or sets the requested number of milliseconds of the interval within the server have to send cyclic notifications to the client.
public int PublishingInterval { get; set; }Public Property PublishingInterval As IntegerProperty value
The interval within the server have to send cyclic notifications to the client. A value of zero or negative indicates that the server have to revise the fastest supported publishing interval.
Remarks
The publishing interval of a subscription defines the cyclic rate at which the subscription executes. Each time it executes, it attempts to send a message to the client. Messages contain notifications that have not yet been reported to client.
The negotiated value of this property is used as the default sampling interval for the MonitoredItems assigned to this OpcSubscription.
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
PublishingIsEnabled
Gets or sets a value indicating whether publishing is enabled for this OpcSubscription.
public bool PublishingIsEnabled { get; set; }Public Property PublishingIsEnabled As BooleanProperty value
The value true if publishing is enabled for this OpcSubscription; otherwise the value false. The default value of this property is true.
Remarks
The value of this property does not affect the value of the monitoring mode property of the MonitoredItems.
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
PublishTime
Gets the time the last notification was published from the server.
public DateTime? PublishTime { get; }Public ReadOnly Property PublishTime As Date?Property value
A DateTime identifying the instant of time the last notification has been published from the server or a null reference (Nothing in Visual Basic) if the OpcSubscription has not yet received a notification from the server or MaxMessageCount is less or equals zero.
ReceivedDataChangeCallback
Gets or sets the callback used to process data changes of the monitored items associated with this OpcSubscription.
public OpcDataChangeReceivedCallback ReceivedDataChangeCallback { get; set; }Public Property ReceivedDataChangeCallback As OpcDataChangeReceivedCallbackProperty value
A OpcDataChangeReceivedCallback used to process data change items. The value can also be a null reference (Nothing in Visual Basic).
Remarks
Use this property to directly handle all data change items without to rely on the chain of registered event handlers.
ReceivedEventCallback
Gets or sets the callback used to process events of the monitored items associated with this OpcSubscription.
public OpcEventReceivedCallback ReceivedEventCallback { get; set; }Public Property ReceivedEventCallback As OpcEventReceivedCallbackProperty value
A OpcDataChangeReceivedCallback used to process event items. The value can also be a null reference (Nothing in Visual Basic).
Remarks
Use this property to directly handle all event items without to rely on the chain of registered event handlers.
SequenceNumber
Gets the sequence number of the last notification which has been received from the server.
public long? SequenceNumber { get; }Public ReadOnly Property SequenceNumber As Long?Property value
The SequenceNumber of the last notification which has been received from the server or a null reference (Nothing in Visual Basic) if the OpcSubscription has not yet received a notification from the server.
Tag
Gets or sets the object that contains additional user data about the subscription.
public object Tag { get; set; }Public Property Tag As ObjectProperty value
An object that contains additional user data about the subscription. The default is null (Nothing in Visual Basic).
TimestampsToReturn
Gets or sets the timestamps the server shall transmit for each monitored item.
public OpcTimestampsToReturn TimestampsToReturn { get; set; }Public Property TimestampsToReturn As OpcTimestampsToReturnProperty value
One of the members defined by the OpcTimestampsToReturn enumeration. The default value of this property is Both.
Remarks
The "timestamps to return" criteria is only applied to OpcValue instances. This means that in case of monitoring events only event fields of the type OpcValue are effected by the value of this property.
The server needs to be notified about changes to this property to take effect. To do so use the ApplyChanges method.
UseMonitoredItemDataCache
Gets or sets a value indicating whether this OpcSubscription shall forward notifications received from the server to monitored item individual caches. This enables the monitored items to process the data changes and event fields on their own.
public bool UseMonitoredItemDataCache { get; set; }Public Property UseMonitoredItemDataCache As BooleanProperty value
The value true if the OpcMonitoredItem instances associated with this OpcSubscription receive their own item-related notification and can process the notification data on their own; otherwise the value false. The default value of this property is true.
Methods
AddMonitoredItem
| Overload | Description |
|---|---|
| AddMonitoredItem( | Adds the monitored item specified by item to this OpcSubscription. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to events on the EventNotifier attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to changes on the EventNotifier attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter. |
| AddMonitoredItem( | Adds the monitored items specified by items to this OpcSubscription. |
| AddMonitoredItem( | Adds the monitored items specified by items to this OpcSubscription. |
AddMonitoredItem(OpcMonitoredItem)
Adds the monitored item specified by item to this OpcSubscription.
public void AddMonitoredItem(OpcMonitoredItem item)Public Sub AddMonitoredItem(item As OpcMonitoredItem)Parameters
| Name | Type | Description |
|---|---|---|
item | OpcMonitoredItem | The OpcMonitoredItem to add. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The item is a null reference ( |
AddMonitoredItem(OpcNodeId)
Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(OpcNodeId nodeId)Public Function AddMonitoredItem(nodeId As OpcNodeId) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its Value attribute is to be monitored. |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcDataChangeReceivedEventHandler)
Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcDataChangeReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its Value attribute is to be monitored. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcEventReceivedEventHandler)
Adds a new monitored item which subscribes to events on the EventNotifier attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcEventReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
received As OpcEventReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its EventNotifier attribute is to be monitored. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeReceivedEventHandler)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute,
OpcDataChangeReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute,
received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventReceivedEventHandler)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute,
OpcEventReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute,
received As OpcEventReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcMonitoringFilter)
Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcMonitoringFilter filter)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
filter As OpcMonitoringFilter) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its Value attribute is to be monitored. |
filter | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)
Adds a new monitored item which subscribes to changes on the Value attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcDataChangeFilter filter,
OpcDataChangeReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
filter As OpcDataChangeFilter,
received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its Value attribute is to be monitored. |
filter | Opc | The Opc |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcEventFilter, OpcEventReceivedEventHandler)
Adds a new monitored item which subscribes to changes on the EventNotifier attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcEventFilter filter,
OpcEventReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
filter As OpcEventFilter,
received As OpcEventReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its EventNotifier attribute is to be monitored. |
filter | OpcEventFilter | The OpcEventFilter to use to apply different conditions while monitoring the attribute. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute, OpcMonitoringFilter)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute,
OpcMonitoringFilter filter)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute,
filter As OpcMonitoringFilter) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
filter | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute,
OpcDataChangeFilter filter,
OpcDataChangeReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute,
filter As OpcDataChangeFilter,
received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
filter | Opc | The Opc |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventFilter, OpcEventReceivedEventHandler)
Adds a new monitored item which subscribes to the attribute of the node specified by nodeId using the further configured filter.
public OpcMonitoredItem AddMonitoredItem(
OpcNodeId nodeId,
OpcAttribute attribute,
OpcEventFilter filter,
OpcEventReceivedEventHandler received)Public Function AddMonitoredItem(
nodeId As OpcNodeId,
attribute As OpcAttribute,
filter As OpcEventFilter,
received As OpcEventReceivedEventHandler) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
nodeId | OpcNodeId | The OpcNodeId of the node its attribute is to be monitored. |
attribute | OpcAttribute | The OpcAttribute to monitor. |
filter | OpcEventFilter | The OpcEventFilter to use to apply different conditions while monitoring the attribute. |
received | Opc | The Opc |
Returns
A new instance of the OpcMonitoredItem class setup with the information specified. The monitored item will then monitor the node identified by the values passed to this method.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The nodeId is empty. |
| Argument | The nodeId is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(IEnumerable<OpcMonitoredItem>)
Adds the monitored items specified by items to this OpcSubscription.
public void AddMonitoredItem(IEnumerable<OpcMonitoredItem> items)Public Sub AddMonitoredItem(items As IEnumerable(Of OpcMonitoredItem))Parameters
| Name | Type | Description |
|---|---|---|
items | IEnumerable<OpcMonitoredItem> | A sequence of OpcMonitoredItem istances to add. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
AddMonitoredItem(params OpcMonitoredItem[])
Adds the monitored items specified by items to this OpcSubscription.
public void AddMonitoredItem(params OpcMonitoredItem[] items)Public Sub AddMonitoredItem(ParamArray items As OpcMonitoredItem())Parameters
| Name | Type | Description |
|---|---|---|
items | params OpcMonitoredItem[] | An array of OpcMonitoredItem istances to add. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server needs to be notified about the new monitored item to take effect. To do so use the ApplyChanges method.
ApplyChanges
Applies any changes made on the current OpcSubscription or on one of its MonitoredItems using the according services of the server connected to.
public void ApplyChanges()Public Sub ApplyChanges()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | The deletion, modification, creation of monitored items or the modification of the subscription has been failed. For more information see exception details. The following issues can lead to that exception: BadNothingToDo, Bad |
ChangeMonitoringMode
| Overload | Description |
|---|---|
| Change | Changes the monitoring mode of all MonitoredItems. |
| Change | Changes the monitoring mode of one or more monitored items. |
| Change | Changes the monitoring mode of one or more monitored items. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | Changing the monitoring mode has failed. For more information see exception details. The following issues can lead to that exception: BadNothingToDo, Bad |
ChangeMonitoringMode(OpcMonitoringMode)
Changes the monitoring mode of all MonitoredItems.
public void ChangeMonitoringMode(OpcMonitoringMode monitoringMode)Public Sub ChangeMonitoringMode(monitoringMode As OpcMonitoringMode)Parameters
| Name | Type | Description |
|---|---|---|
monitoringMode | Opc | The new Opc |
Remarks
The server does not need to be notified about the change to take effect, because of this method directly operates on the server.
ChangeMonitoringMode(OpcMonitoringMode, IEnumerable<OpcMonitoredItem>)
Changes the monitoring mode of one or more monitored items.
public void ChangeMonitoringMode(
OpcMonitoringMode monitoringMode,
IEnumerable<OpcMonitoredItem> items)Public Sub ChangeMonitoringMode(
monitoringMode As OpcMonitoringMode,
items As IEnumerable(Of OpcMonitoredItem))Parameters
| Name | Type | Description |
|---|---|---|
monitoringMode | Opc | The new Opcitems specified. |
items | IEnumerable<OpcMonitoredItem> | A sequence of OpcMonitoredItem instances, assigned to this OpcSubscription, its monitoring mode is to be changed. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server does not need to be notified about the change to take effect, because of this method directly operates on the server.
ChangeMonitoringMode(OpcMonitoringMode, params OpcMonitoredItem[])
Changes the monitoring mode of one or more monitored items.
public void ChangeMonitoringMode(
OpcMonitoringMode monitoringMode,
params OpcMonitoredItem[] items)Public Sub ChangeMonitoringMode(
monitoringMode As OpcMonitoringMode,
ParamArray items As OpcMonitoredItem())Parameters
| Name | Type | Description |
|---|---|---|
monitoringMode | Opc | The new Opcitems specified. |
items | params OpcMonitoredItem[] | An array of OpcMonitoredItem instances, assigned to this OpcSubscription, its monitoring mode is to be changed. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server does not need to be notified about the change to take effect, because of this method directly operates on the server.
GetMonitoredItem
Retrieves the OpcMonitoredItem the dataChange specified belongs to.
public OpcMonitoredItem GetMonitoredItem(OpcDataChangeDataSetItem dataChange)Public Function GetMonitoredItem(
dataChange As OpcDataChangeDataSetItem) As OpcMonitoredItemParameters
| Name | Type | Description |
|---|---|---|
dataChange | Opc | The Opc |
Returns
The OpcMonitoredItem instance which belongs to the dataChange specified or a null reference (Nothing in Visual Basic) if the monitored item referenced by the OpcDataChangeDataSetItem instance could not be determined.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The dataChange is a null reference ( |
OnChanged
Raises the Changed event of the OpcSubscription.
protected virtual void OnChanged(OpcSubscriptionChangedEventArgs e)Protected Overridable Sub OnChanged(e As OpcSubscriptionChangedEventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
OnDataChangeReceived
Raises the DataChangeReceived event of the OpcSubscription.
protected virtual void OnDataChangeReceived(OpcDataChangeReceivedEventArgs e)Protected Overridable Sub OnDataChangeReceived(
e As OpcDataChangeReceivedEventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
OnEventReceived
Raises the EventReceived event of the OpcSubscription.
protected virtual void OnEventReceived(OpcEventReceivedEventArgs e)Protected Overridable Sub OnEventReceived(e As OpcEventReceivedEventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
OnIsPublishingChanged
Raises the IsPublishingChanged event of the OpcSubscription.
protected virtual void OnIsPublishingChanged(EventArgs e)Protected Overridable Sub OnIsPublishingChanged(e As EventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | EventArgs | The event data. |
OnNotificationFailed
Raises the NotificationFailed event of the OpcSubscription.
protected virtual void OnNotificationFailed(OpcNotificationFailedEventArgs e)Protected Overridable Sub OnNotificationFailed(
e As OpcNotificationFailedEventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
OnNotificationReceived
Raises the NotificationReceived event of the OpcSubscription.
protected virtual void OnNotificationReceived(
OpcNotificationReceivedEventArgs e)Protected Overridable Sub OnNotificationReceived(
e As OpcNotificationReceivedEventArgs)Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
RefreshConditions
Forces the server to refresh all current conditions to synchronize the client with the server.
public void RefreshConditions()Public Sub RefreshConditions()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | Refreshing conditions has failed. For more information see exception details. The following issues can lead to that exception: Bad |
Remarks
The server does not need to be notified about the call to take effect, because of this method directly operates on the server.
The client will request a refresh of all condition instances that currenlty are in an interesting state (they have the retain property set to the value true). This includes previous states of a condition instance for which the server maintains branches as well.
A client would typically invoke this method when it initially connects to a server and following any situations, such as communication disruptions, in which it would require resynchronization with the server.
RemoveMonitoredItem
| Overload | Description |
|---|---|
| Remove | Removes the monitored item specified by item from the MonitoredItems of this OpcSubscription. |
| Remove | Removes the monitored items specified by items from the MonitoredItems of this OpcSubscription. |
| Remove | Removes the monitored items specified by items from the MonitoredItems of this OpcSubscription. |
RemoveMonitoredItem(OpcMonitoredItem)
Removes the monitored item specified by item from the MonitoredItems of this OpcSubscription.
public void RemoveMonitoredItem(OpcMonitoredItem item)Public Sub RemoveMonitoredItem(item As OpcMonitoredItem)Parameters
| Name | Type | Description |
|---|---|---|
item | OpcMonitoredItem | The OpcMonitoredItem to remove. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The item is a null reference ( |
Remarks
The server needs to be notified about the orphaned monitored item to take effect. To do so use the ApplyChanges method.
RemoveMonitoredItem(IEnumerable<OpcMonitoredItem>)
Removes the monitored items specified by items from the MonitoredItems of this OpcSubscription.
public void RemoveMonitoredItem(IEnumerable<OpcMonitoredItem> items)Public Sub RemoveMonitoredItem(items As IEnumerable(Of OpcMonitoredItem))Parameters
| Name | Type | Description |
|---|---|---|
items | IEnumerable<OpcMonitoredItem> | A sequence of OpcMonitoredItem instances to remove. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server needs to be notified about the orphaned monitored items to take effect. To do so use the ApplyChanges method.
RemoveMonitoredItem(params OpcMonitoredItem[])
Removes the monitored items specified by items from the MonitoredItems of this OpcSubscription.
public void RemoveMonitoredItem(params OpcMonitoredItem[] items)Public Sub RemoveMonitoredItem(ParamArray items As OpcMonitoredItem())Parameters
| Name | Type | Description |
|---|---|---|
items | params OpcMonitoredItem[] | An array of OpcMonitoredItem instances to remove. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The items is a null reference ( |
Remarks
The server needs to be notified about the orphaned monitored items to take effect. To do so use the ApplyChanges method.
ResendData
Notifies the server to resend the current values of the MonitoredItems monitoring data changes where the MonitoringMode is equals to Reporting.
public void ResendData()Public Sub ResendData()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | The server notification has failed. For more information see exception details. The following issues can lead to that exception: Bad |
StartPublishing
Enables notifications being send from the server to the client for this OpcSubscription.
public void StartPublishing()Public Sub StartPublishing()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | Enabling notifications has failed. For more information see exception details. The following issues can lead to that exception: BadNothingToDo and Bad |
Remarks
The server does not need to be notified about the call to take effect, because of this method directly operates on the server.
StopPublishing
Disables notifications being send from the server to the client for this OpcSubscription.
public void StopPublishing()Public Sub StopPublishing()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | Disabling notifications has failed. For more information see exception details. The following issues can lead to that exception: BadNothingToDo and Bad |
Remarks
The server does not need to be notified about the call to take effect, because of this method directly operates on the server.
ToString
Returns a string that represents the current OpcSubscription.
public override string ToString()Public Overrides Function ToString() As StringReturns
A string that represents the current OpcSubscription including the used DisplayName, the CurrentPublishingIsEnabled and the CurrentPublishingInterval.
Overrides
Unsubscribe
Deletes this OpcSubscription and all its MonitoredItems.
public void Unsubscribe()Public Sub Unsubscribe()Exceptions
| Exception | Condition |
|---|---|
| Invalid | The current OpcSubscription has not yet been created ( |
| OpcException | Changing the monitoring mode has failed. For more information see exception details. The following issues can lead to that exception: BadNothingToDo and Bad |
Remarks
The server does not need to be notified about the call to take effect, because of this method directly operates on the server.
Events
Changed
Occurs then a monitored is added, modified, deleted or changes on the OpcSubscription were applied.
public event OpcSubscriptionChangedEventHandler ChangedPublic Event Changed As OpcSubscriptionChangedEventHandlerEvent type
OpcSubscriptionChangedEventHandler
DataChangeReceived
Occurs then a monitored item receives an event notification which is not handled by an OpcDataChangeReceivedEventHandler on its DataChangeReceived event.
public event OpcDataChangeReceivedEventHandler DataChangeReceivedPublic Event DataChangeReceived As OpcDataChangeReceivedEventHandlerEvent type
OpcDataChangeReceivedEventHandler
Remarks
This event only occurs if an event notification is not handled by the according DataChangeReceived event handler.
EventReceived
Occurs then a monitored item receives an event notification which is not handled by an OpcEventReceivedEventHandler on its EventReceived event.
public event OpcEventReceivedEventHandler EventReceivedPublic Event EventReceived As OpcEventReceivedEventHandlerEvent type
Remarks
This event only occurs if an event notification is not handled by the according EventReceived event handler.
IsPublishingChanged
Occurs then the IsPublishing property has changed.
public event EventHandler IsPublishingChangedPublic Event IsPublishingChanged As EventHandlerEvent type
NotificationFailed
Occurs then a notification message for this OpcSubscription failed to be received, so that its data changes and events do not reach the monitored items.
public event OpcNotificationFailedEventHandler NotificationFailedPublic Event NotificationFailed As OpcNotificationFailedEventHandlerEvent type
OpcNotificationFailedEventHandler
Remarks
The session requests a failed message again from the server until the server no longer holds it. This event occurs once for each message, however often it fails, and once more with BadMessageNotAvailable when the message is lost. An event which is not handled by this event handler is passed to the NotificationFailed event of the OpcClient which owns this OpcSubscription.
NotificationReceived
Occurs then a OpcNotification for this OpcSubscription has been received by the session which owns this OpcSubscription.
public event OpcNotificationReceivedEventHandler NotificationReceivedPublic Event NotificationReceived As OpcNotificationReceivedEventHandlerEvent type

