# OpcSubscriptionSetup Class

> Reference: Defines a set of properties which can be used to create a whole OpcSubscription including its OpcMonitoredItem objects.

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

<dl class="api-definition">
<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>Members</dt>
<dd><a href="./members">OpcSubscriptionSetup Members</a></dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Defines a set of properties which can be used to create a whole [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/) including its [OpcMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcmonitoreditem/) objects.

## Syntax

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

```csharp
public class OpcSubscriptionSetup
```

</div>

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

```vbnet
Public Class OpcSubscriptionSetup
```

</div>

## Inheritance

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

## Constructors

| Name | Description |
|---|---|
| [OpcSubscriptionSetup](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#opcsubscriptionsetup)<span class="api-meta">3 overloads</span> | Initializes a new instance of the OpcSubscriptionSetup class. |

## Properties

| Name | Description |
|---|---|
| [Changed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [DataChangeReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [DisplayName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [EventReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [KeepAliveCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [MaxMessageCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#maxmessagecount) | Gets or sets the maximum number of notifications to keep in the cache. |
| [MaxNotificationsPerPublish](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#maxnotificationsperpublish) | Gets or sets a value which defines the maximum number of notifications that the client wants to receive in a single publish response. |
| [MinLifetimeInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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.opcsubscriptionsetup/members#publishinginterval) and the [LifetimeCount](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#lifetimecount) configured. |
| [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [NotificationFailed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#notificationfailed)<span class="api-meta">since v2.57</span> | Occurs then a notification message for the [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. |
| [NotificationReceived](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [Priority](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |
| [PublishingInterval](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#publishinginterval) | Gets or sets the requested number of milliseconds of the interval within the server have to send cyclic notifications to the client. |
| [PublishingIsEnabled](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [ReceivedDataChangeCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [ReceivedEventCallback](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |
| [TimestampsToReturn](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#timestampstoreturn) | Gets or sets the timestamps the server shall transmit for each monitored item. |
| [UseMonitoredItemDataCache](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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. |

## Methods

| Name | Description |
|---|---|
| [AddMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#addmonitoreditem)<span class="api-meta">15 overloads</span> | 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/). |
| [RemoveMonitoredItem](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#removemonitoreditem)<span class="api-meta">3 overloads</span> | Removes the monitored item specified by `item` from the [MonitoredItems](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#monitoreditems) of this [OpcSubscription](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscription/). |
| [ToString](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcsubscriptionsetup/members#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/). |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.32–v2.59 |
