# OpcClient.WriteNodeValue Method

> Reference: Writes the Value attribute of the node using the further specified value.

<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">since v2.8</span>

Writes the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute of the `node` using the further specified `value`.

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

```csharp
public OpcStatus WriteNodeValue(IOpcNodeValue node, object value)
```

</div>

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

```vbnet
Public Function WriteNodeValue(
    node As IOpcNodeValue,
    value As Object) As OpcStatus
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `node` | [IOpcNodeValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodevalue/) | The [IOpcNodeValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnodevalue/) instance which represents the node its [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) is to be written. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The data to write to the [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#value) attribute. |

**Returns**

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

An instance of the [OpcStatus](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatus/) class which indicates the outcome of the write operation.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `node` is a null reference (Nothing in Visual Basic). |
| [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) | The write service is currently not supported, especially using the `node` 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). |

**Remarks**

Known results for the operation are:

| Status | Description |
|---|---|
| [GoodCompletesAsynchronously](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#goodcompletesasynchronously) | The value was successfully written to an intermediate system but the Server does not know if the data source was updated properly. |
| [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid) | For more details see [BadNodeIdInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidinvalid). |
| [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown) | For more details see [BadNodeIdUnknown](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnodeidunknown). |
| [BadAttributeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badattributeinvalid) | For more details see [BadAttributeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badattributeinvalid). |
| [BadIndexRangeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badindexrangeinvalid) | For more details see [BadIndexRangeInvalid](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badindexrangeinvalid). |
| [BadIndexRangeNoData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badindexrangenodata) | For more details see [BadIndexRangeNoData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badindexrangenodata). |
| [BadWriteNotSupported](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badwritenotsupported) | The requested write operation is not supported. If a client attempts to write any value, quality, timestamp combination and the server does not support the requested combination (which could be a single quantity such as just timestamp), then the Server shall not perform any write on this node and shall return this status for that node. |
| [BadNotWritable](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnotwritable) | For more details see [BadNotWritable](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnotwritable). |
| [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). |
| [BadOutOfRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badoutofrange) | If a client attempts to write a value outside the valid range like a value not contained in the enumeration data type of a node, the server shall return this status for that node. |
| [BadTypeMismatch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypemismatch) | For more details see [BadTypeMismatch](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badtypemismatch). |
| [BadDataEncodingUnsupported](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baddataencodingunsupported) | For more details see [BadDataEncodingUnsupported](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#baddataencodingunsupported). |
| [BadNoCommunication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnocommunication) | For more details see [BadNoCommunication](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnocommunication). |
