# OpcClient.RegisterNodes Method

> Reference: Registers one or more nodes for optimized node access using the specified commands.

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

<span class="api-meta">4 overloads · since v2.8</span>

| Overload | Description |
|---|---|
| [RegisterNodes(IEnumerable&lt;OpcRegisterNode&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/registernodes#registernodes-system-collections-generic-ienumerable-of-opc-uafx-opcregisternode)<span class="api-meta">since v2.8</span> | Registers one or more nodes for optimized node access using the specified `commands`. |
| [RegisterNodes(params OpcRegisterNode\[\])](#registernodes-opc-uafx-opcregisternode-array)<span class="api-meta">since v2.8</span> | Registers one or more nodes for optimized node access using the specified `commands`. |
| [RegisterNodes(IEnumerable&lt;OpcNodeId&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/registernodes#registernodes-system-collections-generic-ienumerable-of-opc-uafx-opcnodeid)<span class="api-meta">since v2.8</span> | Registers one or more nodes for optimized node access using the identifiers of the nodes its access shall be optimized. |
| [RegisterNodes(params OpcNodeId\[\])](#registernodes-opc-uafx-opcnodeid-array)<span class="api-meta">since v2.8</span> | Registers one or more nodes for optimized node access using the identifiers of the nodes its access shall be optimized. |

**Known results:** [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid)

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |

## RegisterNodes(IEnumerable&lt;OpcRegisterNode&gt;)

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

Registers one or more nodes for optimized node access using the specified `commands`.

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

```csharp
public OpcNodeIdCollection RegisterNodes(IEnumerable<OpcRegisterNode> commands)
```

</div>

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

```vbnet
Public Function RegisterNodes(
    commands As IEnumerable(Of OpcRegisterNode)) As OpcNodeIdCollection
```

</div>

**Parameters**

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

**Returns**

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

A collection of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances its number and order of items matches the number and order of items in the `commands` sequence. There is for each command one entry which stores the node identifier requested by that command to use to access the node registered for optimized node access.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence or one of its items is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The register nodes service is currently not supported, especially using the `commands` specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details 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 [BadTooManyMatches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanymatches). |

**Remarks**

Servers completely reject register nodes requests if any of the node identifiers passed are structurally invalid.

## RegisterNodes(params OpcRegisterNode\[\])

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

Registers one or more nodes for optimized node access using the specified `commands`.

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

```csharp
public OpcNodeIdCollection RegisterNodes(params OpcRegisterNode[] commands)
```

</div>

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

```vbnet
Public Function RegisterNodes(
    ParamArray commands As OpcRegisterNode()) As OpcNodeIdCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | params [OpcRegisterNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcregisternode/)[] | A sequence of [OpcRegisterNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcregisternode/) instances to process. |

**Returns**

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

A collection of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances its number and order of items matches the number and order of items in the `commands` sequence. There is for each command one entry which stores the node identifier requested by that command to use to access the node registered for optimized node access.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` sequence or one of its items is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The register nodes service is currently not supported, especially using the `commands` specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details 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 [BadTooManyMatches](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtoomanymatches). |

**Remarks**

Servers completely reject register nodes requests if any of the node identifiers passed are structurally invalid.

## RegisterNodes(IEnumerable&lt;OpcNodeId&gt;)

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

Registers one or more nodes for optimized node access using the identifiers of the nodes its access shall be optimized. One registered nodes have to be unregistered as soon as the optimized node access is not longer required. This assures that the server can release unused resources reserved for the optimized node access.

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

```csharp
public OpcNodeIdCollection RegisterNodes(IEnumerable<OpcNodeId> nodeIds)
```

</div>

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

```vbnet
Public Function RegisterNodes(
    nodeIds As IEnumerable(Of OpcNodeId)) As OpcNodeIdCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeIds` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)&gt; | A sequence of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances through that the nodes to register can be identified. |

**Returns**

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

A collection of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances its items are to be used for subsequent optimized node access. Use these identifiers to release unused resources assoicated with the optimized node access using [UnregisterNodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/unregisternodes#unregisternodes-system-collections-generic-ienumerable-of-opc-uafx-opcnodeid) as soon as the optimized node access is not longer required.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | One of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances in `nodeIds` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeIds` is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The register node service is currently not supported, especially using the parameters specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details 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**

Servers completely reject register nodes requests if any of the node identifiers passed are structurally invalid.

## RegisterNodes(params OpcNodeId\[\])

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

Registers one or more nodes for optimized node access using the identifiers of the nodes its access shall be optimized. One registered nodes have to be unregistered as soon as the optimized node access is not longer required. This assures that the server can release unused resources reserved for the optimized node access.

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

```csharp
public OpcNodeIdCollection RegisterNodes(params OpcNodeId[] nodeIds)
```

</div>

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

```vbnet
Public Function RegisterNodes(
    ParamArray nodeIds As OpcNodeId()) As OpcNodeIdCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `nodeIds` | params [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)[] | An array of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances through that the nodes to register can be identified. |

**Returns**

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

A collection of [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances its items are to be used for subsequent optimized node access. Use these identifiers to release unused resources assoicated with the optimized node access using [UnregisterNodes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/unregisternodes#unregisternodes-system-collections-generic-ienumerable-of-opc-uafx-opcnodeid) as soon as the optimized node access is not longer required.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | One of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) instances in `nodeIds` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `nodeIds` is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The register node service is currently not supported, especially using the parameters specified. |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The service execution failed upon different circumstances; for more details 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**

Servers completely reject register nodes requests if any of the node identifiers passed are structurally invalid.
