# OpcSubscription Members

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

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcSubscription</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.client">Opc.UaFx.Client</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Properties

### Client

<span class="api-meta">since v2.15</span>

Gets the [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) used to setup this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcClient Client { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Client As OpcClient
```

</div>

**Property value**

[OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/)

An instance of the [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) class used to setup this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

### CurrentKeepAliveCount

Gets the actual keep-alive count used by the server for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) which has been negotiated by the server against the [KeepAliveCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#keepalivecount) requested to meet its own constraints.

<div class="api-signature" data-lang="csharp">

```csharp
public long CurrentKeepAliveCount { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CurrentKeepAliveCount As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The negoiated and actual [KeepAliveCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) which has been negotiated by the server against the [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#lifetimecount) requested to meet its own constraints.

<div class="api-signature" data-lang="csharp">

```csharp
public long CurrentLifetimeCount { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CurrentLifetimeCount As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The negoiated and actual [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public int CurrentPriority { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CurrentPriority As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The actual [Priority](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#priority) used.

**Remarks**

For more details see [Priority](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#priority).

### CurrentPublishingInterval

Gets the actual publishing interval used by the server for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) which has been negotiated by the server against the [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#publishinginterval) requested to meet its own constraints.

<div class="api-signature" data-lang="csharp">

```csharp
public double CurrentPublishingInterval { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CurrentPublishingInterval As Double
```

</div>

**Property value**

[Double](https://learn.microsoft.com/dotnet/api/system.double)

The negoiated and actual [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) which has been created and validated by the server against its own constraints.

<div class="api-signature" data-lang="csharp">

```csharp
public bool CurrentPublishingIsEnabled { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property CurrentPublishingIsEnabled As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the server has enabled publishing for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/); otherwise the value false.

### DisplayName

Gets or sets the name of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) used just for display purpose in the client application.

<div class="api-signature" data-lang="csharp">

```csharp
public string DisplayName { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property DisplayName As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

The name of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges)).

<div class="api-signature" data-lang="csharp">

```csharp
public bool HasPendingChanges { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property HasPendingChanges As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public long Id { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Id As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The server-assigned unique identifier for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

**Remarks**

The identifier shall be unique for the entire server, not just for the Session, in order to allow the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) to be transferred to another session.

### IsCreated

Gets a value indicating whether this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has been created on the server.

<div class="api-signature" data-lang="csharp">

```csharp
public bool IsCreated { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property IsCreated As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) is receiving notifications.

<div class="api-signature" data-lang="csharp">

```csharp
public bool IsPublishing { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property IsPublishing As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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.

<div class="api-signature" data-lang="csharp">

```csharp
public long KeepAliveCount { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property KeepAliveCount As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

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](https://learn.microsoft.com/dotnet/api/system.uint32) which is covered using a [long](https://learn.microsoft.com/dotnet/api/system.int64) to assure CLS compliance. In fact this restricts the value range of this property to [MinValue](https://learn.microsoft.com/dotnet/api/system.uint32.minvalue) and [MaxValue](https://learn.microsoft.com/dotnet/api/system.uint32.maxvalue).

**Remarks**

The server needs to be notified about changes to this property to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### LastNotification

Gets the last notification received from the server.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNotification LastNotification { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property LastNotification As OpcNotification
```

</div>

**Property value**

[OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/)

An instance of the [OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/) class which represents the last notfication received from the server or a null reference (Nothing in Visual Basic) if the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet received a notification from the server or [MaxMessageCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#maxmessagecount) is less or equals zero.

### LastNotificationTime

Gets the time the last notification which has been received from the server.

<div class="api-signature" data-lang="csharp">

```csharp
public DateTime? LastNotificationTime { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property LastNotificationTime As Date?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt;

A [DateTime](https://learn.microsoft.com/dotnet/api/system.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public long LifetimeCount { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property LifetimeCount As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#keepalivecount). The default value of this property is 100.

**Remarks**

The value of the underlying property is an [uint](https://learn.microsoft.com/dotnet/api/system.uint32) which is covered using a [long](https://learn.microsoft.com/dotnet/api/system.int64) to assure CLS compliance. In fact this restricts the value range of this property to [MinValue](https://learn.microsoft.com/dotnet/api/system.uint32.minvalue) and [MaxValue](https://learn.microsoft.com/dotnet/api/system.uint32.maxvalue).

The server needs to be notified about changes to this property to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### MaxMessageCount

Gets or sets the maximum number of notifications to keep in the cache.

<div class="api-signature" data-lang="csharp">

```csharp
public int MaxMessageCount { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property MaxMessageCount As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

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.

<div class="api-signature" data-lang="csharp">

```csharp
public long MaxNotificationsPerPublish { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property MaxNotificationsPerPublish As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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](https://learn.microsoft.com/dotnet/api/system.uint32) which is covered using a [long](https://learn.microsoft.com/dotnet/api/system.int64) to assure CLS compliance. In fact this restricts the value range of this property to [MinValue](https://learn.microsoft.com/dotnet/api/system.uint32.minvalue) and [MaxValue](https://learn.microsoft.com/dotnet/api/system.uint32.maxvalue).

### MinLifetimeInterval

Gets or sets a value which defines the minimum lifetime interval to apply in respect of the [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#publishinginterval) and the [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#lifetimecount) configured.

<div class="api-signature" data-lang="csharp">

```csharp
public long MinLifetimeInterval { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property MinLifetimeInterval As Long
```

</div>

**Property value**

[Int64](https://learn.microsoft.com/dotnet/api/system.int64)

The interval which should be a multiple of the [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#publishinginterval) to assure that the [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#lifetimecount) requested is sensible enough to get covered within the [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#publishinginterval).

### MonitoredItems

Gets a read-only collection of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances associated with this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItemReadOnlyCollection MonitoredItems { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property MonitoredItems As OpcMonitoredItemReadOnlyCollection
```

</div>

**Property value**

[OpcMonitoredItemReadOnlyCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditemreadonlycollection/)

An instance of the [OpcMonitoredItemReadOnlyCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditemreadonlycollection/) class.

**Remarks**

Use the monitored item related methods of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) to manipulate the items contained in the collection offered by this property.

### Notifications

Gets a sequence of [OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/) instances received from the server.

<div class="api-signature" data-lang="csharp">

```csharp
public IEnumerable<OpcNotification> Notifications { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Notifications As IEnumerable(Of OpcNotification)
```

</div>

**Property value**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/)&gt;

A sequence of [OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/) instances representing the notifications received from the server. The sequence is empty if the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public int Priority { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Priority As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

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](https://learn.microsoft.com/dotnet/api/system.byte) which is covered using an [int](https://learn.microsoft.com/dotnet/api/system.int32) to assure an even API level. In fact this restricts the value range of this property to [MinValue](https://learn.microsoft.com/dotnet/api/system.byte.minvalue) and [MaxValue](https://learn.microsoft.com/dotnet/api/system.byte.maxvalue).

The server needs to be notified about changes to this property to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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.

<div class="api-signature" data-lang="csharp">

```csharp
public int PublishingInterval { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property PublishingInterval As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) assigned to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

The server needs to be notified about changes to this property to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### PublishingIsEnabled

Gets or sets a value indicating whether publishing is enabled for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public bool PublishingIsEnabled { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property PublishingIsEnabled As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if publishing is enabled for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems).

The server needs to be notified about changes to this property to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### PublishTime

Gets the time the last notification was published from the server.

<div class="api-signature" data-lang="csharp">

```csharp
public DateTime? PublishTime { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property PublishTime As Date?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt;

A [DateTime](https://learn.microsoft.com/dotnet/api/system.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet received a notification from the server or [MaxMessageCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcDataChangeReceivedCallback ReceivedDataChangeCallback { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property ReceivedDataChangeCallback As OpcDataChangeReceivedCallback
```

</div>

**Property value**

[OpcDataChangeReceivedCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedcallback/)

A [OpcDataChangeReceivedCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcEventReceivedCallback ReceivedEventCallback { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property ReceivedEventCallback As OpcEventReceivedCallback
```

</div>

**Property value**

[OpcEventReceivedCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedcallback/)

A [OpcDataChangeReceivedCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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.

<div class="api-signature" data-lang="csharp">

```csharp
public long? SequenceNumber { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property SequenceNumber As Long?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[Int64](https://learn.microsoft.com/dotnet/api/system.int64)&gt;

The [SequenceNumber](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/members#sequencenumber) of the last notification which has been received from the server or a null reference (Nothing in Visual Basic) if the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet received a notification from the server.

### Tag

Gets or sets the object that contains additional user data about the subscription.

<div class="api-signature" data-lang="csharp">

```csharp
public object Tag { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property Tag As Object
```

</div>

**Property value**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

An [object](https://learn.microsoft.com/dotnet/api/system.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.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcTimestampsToReturn TimestampsToReturn { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property TimestampsToReturn As OpcTimestampsToReturn
```

</div>

**Property value**

[OpcTimestampsToReturn](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctimestampstoreturn/)

One of the members defined by the [OpcTimestampsToReturn](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctimestampstoreturn/) enumeration. The default value of this property is [Both](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctimestampstoreturn/#both).

**Remarks**

The "timestamps to return" criteria is only applied to [OpcValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvalue/) instances. This means that in case of monitoring events only event fields of the type [OpcValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### UseMonitoredItemDataCache

Gets or sets a value indicating whether this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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.

<div class="api-signature" data-lang="csharp">

```csharp
public bool UseMonitoredItemDataCache { get; set; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Property UseMonitoredItemDataCache As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances associated with this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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

<span class="api-meta">15 overloads</span>

| Overload | Description |
|---|---|
| [AddMonitoredItem(OpcMonitoredItem)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-client-opcmonitoreditem) | Adds the monitored item specified by `item` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |
| [AddMonitoredItem(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcDataChangeReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-client-opcdatachangereceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcEventReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-client-opceventreceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to events on the [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute-opc-uafx-client-opcdatachangereceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute-opc-uafx-client-opceventreceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`. |
| [AddMonitoredItem(OpcNodeId, OpcMonitoringFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcmonitoringfilter)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(OpcNodeId, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcdatachangefilter-opc-uafx-client-opcdatachangereceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(OpcNodeId, OpcEventFilter, OpcEventReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opceventfilter-opc-uafx-client-opceventreceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to changes on the [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute, OpcMonitoringFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute-opc-uafx-opcmonitoringfilter)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute-opc-uafx-opcdatachangefilter-opc-uafx-client-opcdatachangereceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventFilter, OpcEventReceivedEventHandler)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-opc-uafx-opcnodeid-opc-uafx-opcattribute-opc-uafx-opceventfilter-opc-uafx-client-opceventreceivedeventhandler)<span class="api-meta">since v2.7</span> | Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`. |
| [AddMonitoredItem(IEnumerable&lt;OpcMonitoredItem&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#addmonitoreditem-system-collections-generic-ienumerable-of-opc-uafx-client-opcmonitoreditem) | Adds the monitored items specified by `items` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |
| [AddMonitoredItem(params OpcMonitoredItem\[\])](#addmonitoreditem-opc-uafx-client-opcmonitoreditem-array) | Adds the monitored items specified by `items` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |

#### AddMonitoredItem(OpcMonitoredItem)

Adds the monitored item specified by `item` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void AddMonitoredItem(OpcMonitoredItem item)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub AddMonitoredItem(item As OpcMonitoredItem)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `item` | [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) | The [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) to add. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `item` is a null reference (Nothing in Visual Basic). |

#### AddMonitoredItem(OpcNodeId)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(OpcNodeId nodeId)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(nodeId As OpcNodeId) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute is to be monitored. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcDataChangeReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcDataChangeReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute is to be monitored. |
| `received` | [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) | The [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) method to assign as the event handler of the [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcEventReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to events on the [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcEventReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    received As OpcEventReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute is to be monitored. |
| `received` | [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) | The [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) method to assign as the event handler of the [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcDataChangeReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |
| `received` | [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) | The [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) method to assign as the event handler of the [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcEventReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    received As OpcEventReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |
| `received` | [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) | The [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) method to assign as the event handler of the [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcMonitoringFilter)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcMonitoringFilter filter)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    filter As OpcMonitoringFilter) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute is to be monitored. |
| `filter` | [OpcMonitoringFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringfilter/) | The [OpcMonitoringFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringfilter/) (either a [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) or a [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/)) to use to apply different conditions while monitoring the attribute. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to changes on the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcDataChangeFilter filter,
    OpcDataChangeReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    filter As OpcDataChangeFilter,
    received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute is to be monitored. |
| `filter` | [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) | The [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) to use to apply different conditions while monitoring the attribute. |
| `received` | [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) | The [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) method to assign as the event handler of the [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcEventFilter, OpcEventReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to changes on the [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcEventFilter filter,
    OpcEventReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    filter As OpcEventFilter,
    received As OpcEventReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its [EventNotifier](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#eventnotifier) attribute is to be monitored. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) | The [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) to use to apply different conditions while monitoring the attribute. |
| `received` | [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) | The [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) method to assign as the event handler of the [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute, OpcMonitoringFilter)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcMonitoringFilter filter)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    filter As OpcMonitoringFilter) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |
| `filter` | [OpcMonitoringFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringfilter/) | The [OpcMonitoringFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringfilter/) (either a [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) or a [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/)) to use to apply different conditions while monitoring the attribute. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute, OpcDataChangeFilter, OpcDataChangeReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcDataChangeFilter filter,
    OpcDataChangeReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    filter As OpcDataChangeFilter,
    received As OpcDataChangeReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |
| `filter` | [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) | The [OpcDataChangeFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangefilter/) to use to apply different conditions while monitoring the attribute. |
| `received` | [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) | The [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) method to assign as the event handler of the [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(OpcNodeId, OpcAttribute, OpcEventFilter, OpcEventReceivedEventHandler)

<span class="api-meta">since v2.7</span>

Adds a new monitored item which subscribes to the `attribute` of the node specified by `nodeId` using the further configured `filter`.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem AddMonitoredItem(
    OpcNodeId nodeId,
    OpcAttribute attribute,
    OpcEventFilter filter,
    OpcEventReceivedEventHandler received)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function AddMonitoredItem(
    nodeId As OpcNodeId,
    attribute As OpcAttribute,
    filter As OpcEventFilter,
    received As OpcEventReceivedEventHandler) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) of the node its `attribute` is to be monitored. |
| `attribute` | [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) | The [OpcAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/) to monitor. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) | The [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) to use to apply different conditions while monitoring the attribute. |
| `received` | [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) | The [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) method to assign as the event handler of the [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event or a null reference (Nothing in Visual Basic) if there no event handler is to be assigned first. |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

A new instance of the [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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 |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `nodeId` is empty. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(IEnumerable&lt;OpcMonitoredItem&gt;)

Adds the monitored items specified by `items` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void AddMonitoredItem(IEnumerable<OpcMonitoredItem> items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub AddMonitoredItem(items As IEnumerable(Of OpcMonitoredItem))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `items` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)&gt; | A sequence of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) istances to add. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### AddMonitoredItem(params OpcMonitoredItem\[\])

Adds the monitored items specified by `items` to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void AddMonitoredItem(params OpcMonitoredItem[] items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub AddMonitoredItem(ParamArray items As OpcMonitoredItem())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `items` | params [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)[] | An array of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) istances to add. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the new monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### ApplyChanges

Applies any changes made on the current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) or on one of its [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) using the according services of the server connected to.

<div class="api-signature" data-lang="csharp">

```csharp
public void ApplyChanges()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub ApplyChanges()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo), [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations), [BadTimestampsToReturnInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtimestampstoreturninvalid), [BadSubscriptionIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsubscriptionidinvalid) and [BadMonitoredItemIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badmonitoreditemidinvalid). |

### ChangeMonitoringMode

<span class="api-meta">3 overloads</span>

| Overload | Description |
|---|---|
| [ChangeMonitoringMode(OpcMonitoringMode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#changemonitoringmode-opc-uafx-opcmonitoringmode)<span class="api-meta">since v2.11</span> | Changes the monitoring mode of all [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems). |
| [ChangeMonitoringMode(OpcMonitoringMode, IEnumerable&lt;OpcMonitoredItem&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#changemonitoringmode-opc-uafx-opcmonitoringmode-system-collections-generic-ienumerable-of-opc-uafx-client-opcmonitoreditem) | Changes the monitoring mode of one or more monitored items. |
| [ChangeMonitoringMode(OpcMonitoringMode, params OpcMonitoredItem\[\])](#changemonitoringmode-opc-uafx-opcmonitoringmode-opc-uafx-client-opcmonitoreditem-array) | Changes the monitoring mode of one or more monitored items. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | Changing the monitoring mode has failed. For more information see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo), [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations), [BadSubscriptionIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsubscriptionidinvalid) and [BadMonitoringModeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badmonitoringmodeinvalid). |

#### ChangeMonitoringMode(OpcMonitoringMode)

<span class="api-meta">since v2.11</span>

Changes the monitoring mode of all [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems).

<div class="api-signature" data-lang="csharp">

```csharp
public void ChangeMonitoringMode(OpcMonitoringMode monitoringMode)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub ChangeMonitoringMode(monitoringMode As OpcMonitoringMode)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `monitoringMode` | [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) | The new [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) to apply on all [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |

**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&lt;OpcMonitoredItem&gt;)

Changes the monitoring mode of one or more monitored items.

<div class="api-signature" data-lang="csharp">

```csharp
public void ChangeMonitoringMode(
    OpcMonitoringMode monitoringMode,
    IEnumerable<OpcMonitoredItem> items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub ChangeMonitoringMode(
    monitoringMode As OpcMonitoringMode,
    items As IEnumerable(Of OpcMonitoredItem))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `monitoringMode` | [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) | The new [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) to apply on the `items` specified. |
| `items` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)&gt; | A sequence of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances, assigned to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/), its monitoring mode is to be changed. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

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

<div class="api-signature" data-lang="csharp">

```csharp
public void ChangeMonitoringMode(
    OpcMonitoringMode monitoringMode,
    params OpcMonitoredItem[] items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub ChangeMonitoringMode(
    monitoringMode As OpcMonitoringMode,
    ParamArray items As OpcMonitoredItem())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `monitoringMode` | [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) | The new [OpcMonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/) to apply on the `items` specified. |
| `items` | params [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)[] | An array of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances, assigned to this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/), its monitoring mode is to be changed. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

**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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) the `dataChange` specified belongs to.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcMonitoredItem GetMonitoredItem(OpcDataChangeDataSetItem dataChange)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function GetMonitoredItem(
    dataChange As OpcDataChangeDataSetItem) As OpcMonitoredItem
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataChange` | [OpcDataChangeDataSetItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangedatasetitem/) | The [OpcDataChangeDataSetItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangedatasetitem/) the according [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) is to be determined from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |

**Returns**

[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)

The [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instance which belongs to the `dataChange` specified or a null reference (Nothing in Visual Basic) if the monitored item referenced by the [OpcDataChangeDataSetItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatachangedatasetitem/) instance could not be determined.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataChange` is a null reference (Nothing in Visual Basic). |

### OnChanged

<span class="api-meta">protected · virtual</span>

Raises the [Changed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#changed) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnChanged(OpcSubscriptionChangedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnChanged(e As OpcSubscriptionChangedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcSubscriptionChangedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionchangedeventargs/) | The event data. |

### OnDataChangeReceived

<span class="api-meta">protected · virtual</span>

Raises the [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#datachangereceived) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnDataChangeReceived(OpcDataChangeReceivedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnDataChangeReceived(
    e As OpcDataChangeReceivedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcDataChangeReceivedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventargs/) | The event data. |

### OnEventReceived

<span class="api-meta">protected · virtual</span>

Raises the [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#eventreceived) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnEventReceived(OpcEventReceivedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnEventReceived(e As OpcEventReceivedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcEventReceivedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventargs/) | The event data. |

### OnIsPublishingChanged

<span class="api-meta">protected · virtual</span>

Raises the [IsPublishingChanged](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#ispublishingchanged) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnIsPublishingChanged(EventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnIsPublishingChanged(e As EventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [EventArgs](https://learn.microsoft.com/dotnet/api/system.eventargs) | The event data. |

### OnNotificationFailed

<span class="api-meta">protected · virtual · since v2.57</span>

Raises the [NotificationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#notificationfailed) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnNotificationFailed(OpcNotificationFailedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnNotificationFailed(
    e As OpcNotificationFailedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcNotificationFailedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcnotificationfailedeventargs/) | The event data. |

### OnNotificationReceived

<span class="api-meta">protected · virtual</span>

Raises the [NotificationReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#notificationreceived) event of the [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
protected virtual void OnNotificationReceived(
    OpcNotificationReceivedEventArgs e)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Protected Overridable Sub OnNotificationReceived(
    e As OpcNotificationReceivedEventArgs)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `e` | [OpcNotificationReceivedEventArgs](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcnotificationreceivedeventargs/) | The event data. |

### RefreshConditions

Forces the server to refresh all current conditions to synchronize the client with the server.

<div class="api-signature" data-lang="csharp">

```csharp
public void RefreshConditions()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RefreshConditions()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | Refreshing conditions has failed. For more information see exception details. The following issues can lead to that exception: [BadSubscriptionIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsubscriptionidinvalid), [BadRefreshInProgress](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badrefreshinprogress) and [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

**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

<span class="api-meta">3 overloads</span>

| Overload | Description |
|---|---|
| [RemoveMonitoredItem(OpcMonitoredItem)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#removemonitoreditem-opc-uafx-client-opcmonitoreditem) | Removes the monitored item specified by `item` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |
| [RemoveMonitoredItem(IEnumerable&lt;OpcMonitoredItem&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#removemonitoreditem-system-collections-generic-ienumerable-of-opc-uafx-client-opcmonitoreditem) | Removes the monitored items specified by `items` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |
| [RemoveMonitoredItem(params OpcMonitoredItem\[\])](#removemonitoreditem-opc-uafx-client-opcmonitoreditem-array) | Removes the monitored items specified by `items` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |

#### RemoveMonitoredItem(OpcMonitoredItem)

Removes the monitored item specified by `item` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void RemoveMonitoredItem(OpcMonitoredItem item)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RemoveMonitoredItem(item As OpcMonitoredItem)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `item` | [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) | The [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `item` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the orphaned monitored item to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### RemoveMonitoredItem(IEnumerable&lt;OpcMonitoredItem&gt;)

Removes the monitored items specified by `items` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void RemoveMonitoredItem(IEnumerable<OpcMonitoredItem> items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RemoveMonitoredItem(items As IEnumerable(Of OpcMonitoredItem))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `items` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)&gt; | A sequence of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the orphaned monitored items to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

#### RemoveMonitoredItem(params OpcMonitoredItem\[\])

Removes the monitored items specified by `items` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void RemoveMonitoredItem(params OpcMonitoredItem[] items)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub RemoveMonitoredItem(ParamArray items As OpcMonitoredItem())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `items` | params [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/)[] | An array of [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) instances to remove. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `items` is a null reference (Nothing in Visual Basic). |

**Remarks**

The server needs to be notified about the orphaned monitored items to take effect. To do so use the [ApplyChanges](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#applychanges) method.

### ResendData

<span class="api-meta">since v2.51</span>

Notifies the server to resend the current values of the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems) monitoring data changes where the [MonitoringMode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#monitoringmode) is equals to [Reporting](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcmonitoringmode/#reporting).

<div class="api-signature" data-lang="csharp">

```csharp
public void ResendData()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub ResendData()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The server notification has failed. For more information see exception details. The following issues can lead to that exception: [BadSubscriptionIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badsubscriptionidinvalid) and [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

### StartPublishing

Enables notifications being send from the server to the client for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void StartPublishing()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub StartPublishing()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | Enabling notifications has failed. For more information see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) and [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations). |

**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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public void StopPublishing()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub StopPublishing()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | Disabling notifications has failed. For more information see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) and [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations). |

**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

<span class="api-meta">override</span>

Returns a string that represents the current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public override string ToString()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Overrides Function ToString() As String
```

</div>

**Returns**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A string that represents the current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) including the used [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#displayname), the [CurrentPublishingIsEnabled](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#currentpublishingisenabled) and the [CurrentPublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#currentpublishinginterval).

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

### Unsubscribe

Deletes this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) and all its [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#monitoreditems).

<div class="api-signature" data-lang="csharp">

```csharp
public void Unsubscribe()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Unsubscribe()
```

</div>

**Exceptions**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The current [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has not yet been created (see [IsCreated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#iscreated)). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | Changing the monitoring mode has failed. For more information see exception details. The following issues can lead to that exception: [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) and [BadTooManyOperations](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanyoperations). |

**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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) were applied.

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcSubscriptionChangedEventHandler Changed
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event Changed As OpcSubscriptionChangedEventHandler
```

</div>

**Event type**

[OpcSubscriptionChangedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionchangedeventhandler/)

### DataChangeReceived

Occurs then a monitored item receives an event notification which is not handled by an [OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/) on its [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event.

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcDataChangeReceivedEventHandler DataChangeReceived
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event DataChangeReceived As OpcDataChangeReceivedEventHandler
```

</div>

**Event type**

[OpcDataChangeReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcdatachangereceivedeventhandler/)

**Remarks**

This event only occurs if an event notification is not handled by the according [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#datachangereceived) event handler.

### EventReceived

Occurs then a monitored item receives an event notification which is not handled by an [OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/) on its [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event.

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcEventReceivedEventHandler EventReceived
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event EventReceived As OpcEventReceivedEventHandler
```

</div>

**Event type**

[OpcEventReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opceventreceivedeventhandler/)

**Remarks**

This event only occurs if an event notification is not handled by the according [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/members#eventreceived) event handler.

### IsPublishingChanged

Occurs then the [IsPublishing](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/members#ispublishing) property has changed.

<div class="api-signature" data-lang="csharp">

```csharp
public event EventHandler IsPublishingChanged
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event IsPublishingChanged As EventHandler
```

</div>

**Event type**

[EventHandler](https://learn.microsoft.com/dotnet/api/system.eventhandler)

### NotificationFailed

<span class="api-meta">since v2.57</span>

Occurs then a notification message for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) failed to be received, so that its data changes and events do not reach the monitored items.

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcNotificationFailedEventHandler NotificationFailed
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event NotificationFailed As OpcNotificationFailedEventHandler
```

</div>

**Event type**

[OpcNotificationFailedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.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](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badmessagenotavailable) when the message is lost. An event which is not handled by this event handler is passed to the [NotificationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/notificationfailed) event of the [OpcClient](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/) which owns this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

### NotificationReceived

Occurs then a [OpcNotification](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnotification/) for this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) has been received by the session which owns this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/).

<div class="api-signature" data-lang="csharp">

```csharp
public event OpcNotificationReceivedEventHandler NotificationReceived
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Event NotificationReceived As OpcNotificationReceivedEventHandler
```

</div>

**Event type**

[OpcNotificationReceivedEventHandler](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcnotificationreceivedeventhandler/)
