# OpcClient.AddVariableNode Method

> Reference: Adds a new variable node into the address space hierarchy using the specified type of variable node to add, which shall be accessible by the name defined.

<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">10 overloads · since v2.7</span>

| Overload | Description |
|---|---|
| [AddVariableNode(OpcVariableType, OpcName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` defined. |
| [AddVariableNode(OpcVariableType, OpcName, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-system-object)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-system-object)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid-system-object)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcReferenceType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid-opc-uafx-opcreferencetype)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcReferenceType, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid-opc-uafx-opcreferencetype-system-object)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid-opc-uafx-opcnodeid)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |
| [AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcNodeId, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.client.opcclient/addvariablenode#addvariablenode-opc-uafx-opcvariabletype-opc-uafx-opcname-opc-uafx-opcnodeid-opc-uafx-opcnodeid-opc-uafx-opcnodeid-system-object)<span class="api-meta">since v2.7</span> | Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The add node service is currently not supported, especially using the parameters specified. |
| [ObjectDisposedException](https://learn.microsoft.com/dotnet/api/system.objectdisposedexception) | The object has been disposed of. |
| [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). |

## AddVariableNode(OpcVariableType, OpcName)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` defined. The according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) to identify and access the new node is determined by the service. The new node will be a child of the [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder) node using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(OpcVariableType type, OpcName name)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, object)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` defined. The according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) to identify and access the new node is determined by the service. The new node will be a child of the [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder) node using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    object value)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    value As Object) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The initial value of the new variable node. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder) node using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` or `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, object)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the [ObjectsFolder](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjecttypes/members#objectsfolder) node using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    object value)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    value As Object) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The initial value of the new variable node. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` or `nodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId` or `parentNodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, object)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId,
    object value)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId,
    value As Object) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The initial value of the new variable node. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId` or `parentNodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcReferenceType)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using the `referenceType` specified as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId,
    OpcReferenceType referenceType)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId,
    referenceType As OpcReferenceType) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the reference between the new node and the existing parent node identified by `parentNodeId`. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId` or `parentNodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcReferenceType, object)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using the `referenceType` specified as the type of reference.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId,
    OpcReferenceType referenceType,
    object value)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId,
    referenceType As OpcReferenceType,
    value As Object) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using [HasComponent](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/#hascomponent) as the type of reference. |
| `referenceType` | [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) | One of the members defined by the [OpcReferenceType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreferencetype/) enumeration to use to setup the reference between the new node and the existing parent node identified by `parentNodeId`. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The initial value of the new variable node. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId` or `parentNodeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcNodeId)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId,
    OpcNodeId referenceTypeId)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId,
    referenceTypeId As OpcNodeId) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using the type of reference identified by `referenceTypeId`. |
| `referenceTypeId` | [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/) which identifies the type of reference to use for the new node and the existing parent node identified by `parentNodeId`. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` or `referenceTypeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId`, `parentNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |

## AddVariableNode(OpcVariableType, OpcName, OpcNodeId, OpcNodeId, OpcNodeId, object)

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

Adds a new variable node into the address space hierarchy using the specified `type` of variable node to add, which shall be accessible by the `name` and `nodeId` defined. The new node will be a child of the node identified by `parentNodeId` using the type of reference identified by the `referenceTypeId` specified.

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

```csharp
public OpcAddNodeResult AddVariableNode(
    OpcVariableType type,
    OpcName name,
    OpcNodeId nodeId,
    OpcNodeId parentNodeId,
    OpcNodeId referenceTypeId,
    object value)
```

</div>

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

```vbnet
Public Function AddVariableNode(
    type As OpcVariableType,
    name As OpcName,
    nodeId As OpcNodeId,
    parentNodeId As OpcNodeId,
    referenceTypeId As OpcNodeId,
    value As Object) As OpcAddNodeResult
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) | One of the members defined by the [OpcVariableType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariabletype/) enumeration which identifies the predefined underlying type definition the new node will represent an instance of. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new variable node can be accessed. |
| `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/) through that the new node can be identified and accessed. In case there [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) is specified the server will determine the according [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) by its own. |
| `parentNodeId` | [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 parent node to reference using the type of reference identified by `referenceTypeId`. |
| `referenceTypeId` | [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/) which identifies the type of reference to use for the new node and the existing parent node identified by `parentNodeId`. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The initial value of the new variable node. |

**Returns**

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

An instance of the [OpcAddNodeResult](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcaddnoderesult/) class which contains the node identifier used or created for the node added through the the call to the add nodes service; together with information about the outcome of the processed service invocation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `parentNodeId` or `referenceTypeId` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#null) or `name` is equals [Null](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/members#null). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name`, `nodeId`, `parentNodeId` or `referenceTypeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

Known results for the service invocation are:

| Status | Description |
|---|---|
| [BadParentNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badparentnodeidinvalid) | The parent node id does not refer to a valid node. |
| [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid) | For more details see [BadReferenceTypeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencetypeidinvalid). |
| [BadReferenceNotAllowed](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badreferencenotallowed) | The reference could not be created because it violates constraints imposed by the data model. |
| [BadNodeIdRejected](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidrejected) | The requested node id is already used by another node. |
| [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid) | For more details see [BadNodeClassInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeclassinvalid). |
| [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid) | For more details see [BadBrowseNameInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameinvalid). |
| [BadBrowseNameDuplicated](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badbrowsenameduplicated) | The browse name is not unique among nodes that share the same relationship with the parent. |
| [BadNodeAttributesInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeattributesinvalid) | The node attributes are not valid for the node class. |
| [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid) | For more details see [BadTypeDefinitionInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypedefinitioninvalid). |
| [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied) | For more details see [BadUserAccessDenied](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baduseraccessdenied). |
