# OpcVariableValue&lt;T&gt; Members

> Reference: Represents the immutable value of a variable.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcVariableValue&lt;T&gt;</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

Inherits members from [OpcAttributeValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattributevalue-1/members).

## Constructors

### OpcVariableValue

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

| Overload | Description |
|---|---|
| [OpcVariableValue(T)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#opcvariablevalue-t0) | Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value` specified. |
| [OpcVariableValue(T, DateTime)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#opcvariablevalue-t0-system-datetime) | Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value` and `timestamp` specified. |
| [OpcVariableValue(T, DateTime, OpcStatus)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#opcvariablevalue-t0-system-datetime-opc-uafx-opcstatus) | Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value`, `timestamp` and `status` specified. |
| [OpcVariableValue(T, DateTime, OpcStatusCode)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#opcvariablevalue-t0-system-datetime-opc-uafx-opcstatuscode) | Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value`, `timestamp` and `statusCode` specified. |

#### OpcVariableValue(T)

Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value` specified.

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

```csharp
public OpcVariableValue(T value)
```

</div>

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

```vbnet
Public Sub New(value As T)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | T | The value of the variable value represented. |

#### OpcVariableValue(T, DateTime)

Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value` and `timestamp` specified.

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

```csharp
public OpcVariableValue(T value, DateTime timestamp)
```

</div>

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

```vbnet
Public Sub New(value As T, timestamp As Date)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | T | The value of the variable value represented. |
| `timestamp` | [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) | The time stamp of the variable value. |

#### OpcVariableValue(T, DateTime, OpcStatus)

Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value`, `timestamp` and `status` specified.

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

```csharp
public OpcVariableValue(T value, DateTime timestamp, OpcStatus status)
```

</div>

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

```vbnet
Public Sub New(value As T, timestamp As Date, status As OpcStatus)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | T | The value of the variable value represented. |
| `timestamp` | [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) | The time stamp of the variable value. |
| `status` | [OpcStatus](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatus/) | The status associated with the variable value. |

#### OpcVariableValue(T, DateTime, OpcStatusCode)

Initializes a new instance of the [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) class using the `value`, `timestamp` and `statusCode` specified.

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

```csharp
public OpcVariableValue(T value, DateTime timestamp, OpcStatusCode statusCode)
```

</div>

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

```vbnet
<CLSCompliant(False)>
Public Sub New(value As T, timestamp As Date, statusCode As OpcStatusCode)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | T | The value of the variable value represented. |
| `timestamp` | [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) | The time stamp of the variable value. |
| `statusCode` | [OpcStatusCode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/) | The [OpcStatusCode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/) form that the [OpcStatus](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatus/) associated with the variable value is derived. |

## Properties

### Status

Gets the status information associated with the variable value.

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

```csharp
public OpcStatus Status { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Status As OpcStatus
```

</div>

**Property value**

[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 containing the status information associated with the variable value.

### Timestamp

Gets the time stamp of the variable value.

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

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

</div>

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

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

</div>

**Property value**

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

The [DateTime](https://learn.microsoft.com/dotnet/api/system.datetime) identifying the time stamp of the value or a null reference (Nothing in Visual Basic) in case there is no time stamp associated with the variable value.

## Methods

### ToString

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

Returns a string that represents the current [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/).

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

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

</div>

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

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

</div>

**Returns**

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

A string that represents the current [OpcVariableValue&lt;T&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/) including the [Status](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#status), [Timestamp](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablevalue-1/members#timestamp) (if available), [Attribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattributevalue-1/members#attribute) and [Value](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattributevalue-1/members#value).

**Overrides**

[ToString()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattributevalue-1/members#tostring)
