# OpcValueRange Members

> Reference: Defines the range for a value.

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

## Constructors

### OpcValueRange

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

| Overload | Description |
|---|---|
| [OpcValueRange()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#opcvaluerange-noparams) | Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class. |
| [OpcValueRange(double)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#opcvaluerange-system-double) | Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class using the `high` limit specified with the lower limit equals to zero. |
| [OpcValueRange(double, double)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#opcvaluerange-system-double-system-double) | Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class using the `high` and `low` limit specified. |

#### OpcValueRange()

Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class.

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

```csharp
public OpcValueRange()
```

</div>

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

```vbnet
Public Sub New()
```

</div>

**Remarks**

An instance created using this constructor results into a range with the lower and upper limit equals to zero.

#### OpcValueRange(double)

Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class using the `high` limit specified with the lower limit equals to zero.

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

```csharp
public OpcValueRange(double high)
```

</div>

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

```vbnet
Public Sub New(high As Double)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `high` | [Double](https://learn.microsoft.com/dotnet/api/system.double) | The upper limit of a value. |

**Remarks**

If `high` is less then zero, the [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) limit will become zero and the [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) limit will define the value specified by `high`.

#### OpcValueRange(double, double)

Initializes a new instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class using the `high` and `low` limit specified.

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

```csharp
public OpcValueRange(double high, double low)
```

</div>

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

```vbnet
Public Sub New(high As Double, low As Double)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `high` | [Double](https://learn.microsoft.com/dotnet/api/system.double) | The upper limit of a value. |
| `low` | [Double](https://learn.microsoft.com/dotnet/api/system.double) | The lower limit of a value. |

**Remarks**

If `high` is less than `low` then [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) will have the value of `low` and [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) will have the value of `high`.

## Properties

### High

Gets or sets the highest value in the range.

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

```csharp
public double High { get; set; }
```

</div>

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

```vbnet
Public Property High As Double
```

</div>

**Property value**

[Double](https://learn.microsoft.com/dotnet/api/system.double)

The highest value in the range representing the upper limit.

### Low

Gets or sets the lowest value in the range.

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

```csharp
public double Low { get; set; }
```

</div>

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

```vbnet
Public Property Low As Double
```

</div>

**Property value**

[Double](https://learn.microsoft.com/dotnet/api/system.double)

The lowest value in the range representing the lower limit.

### Magnitude

Gets the mathematical distance between [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high).

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

```csharp
public double Magnitude { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Magnitude As Double
```

</div>

**Property value**

[Double](https://learn.microsoft.com/dotnet/api/system.double)

The mathematical distance determined by the absolute difference between [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high).

## Methods

### Of

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

| Overload | Description |
|---|---|
| [Of&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#of-t1)<span class="api-meta">static · since v2.10</span> | Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `T`. |
| [Of(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#of-system-type)<span class="api-meta">static · since v2.10</span> | Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `type`. |
| [Of(OpcDataType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#of-opc-uafx-opcdatatype)<span class="api-meta">static · since v2.10</span> | Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `type`. |
| [Of(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#of-opc-uafx-opcnodeid)<span class="api-meta">static · since v2.10</span> | Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type identified by the specified `typeId`. |

#### Of&lt;T&gt;()

<span class="api-meta">static · since v2.10</span>

Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `T`.

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

```csharp
public static OpcValueRange Of<T>()
```

</div>

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

```vbnet
Public Shared Function [Of](Of T)() As OpcValueRange
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type which is reflected to look up a 'MinValue' and a 'MaxValue' field to determine the [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) values of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) to determine. |

**Returns**

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

The [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) with the according 'MinValue' for [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and the 'MaxValue' for [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) or a null reference (Nothing in Visual Basic) if the type specified does not provide a 'MinValue' and 'MaxValue' field.

**Remarks**

To determine the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) 'MinValue' and 'MaxValue' are required as static fields which offer [IConvertible](https://learn.microsoft.com/dotnet/api/system.iconvertible) values.

#### Of(Type)

<span class="api-meta">static · since v2.10</span>

Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `type`.

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

```csharp
public static OpcValueRange Of(Type type)
```

</div>

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

```vbnet
Public Shared Function [Of](type As Type) As OpcValueRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) which is reflected to look up a 'MinValue' and a 'MaxValue' field to determine the [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) values of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) to determine. |

**Returns**

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

The [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) with the according 'MinValue' for [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and the 'MaxValue' for [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) or a null reference (Nothing in Visual Basic) if the `type` specified does not provide a 'MinValue' and 'MaxValue' field or if `type` is a null reference (Nothing in Visual Basic).

**Remarks**

To determine the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) 'MinValue' and 'MaxValue' are required as static fields which offer [IConvertible](https://learn.microsoft.com/dotnet/api/system.iconvertible) values.

#### Of(OpcDataType)

<span class="api-meta">static · since v2.10</span>

Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type specified by `type`.

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

```csharp
public static OpcValueRange Of(OpcDataType type)
```

</div>

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

```vbnet
Public Shared Function [Of](type As OpcDataType) As OpcValueRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `type` | [OpcDataType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatype/) | One of the members defined by the [OpcDataType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatype/) enumeration its underlying [Type](https://learn.microsoft.com/dotnet/api/system.type) is reflected to look up a 'MinValue' and a 'MaxValue' property to determine the [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) values of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) to determine. |

**Returns**

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

The [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) with the according 'MinValue' for [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and the 'MaxValue' for [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) or a null reference (Nothing in Visual Basic) if the according [Type](https://learn.microsoft.com/dotnet/api/system.type) of the `type` specified does not provide a 'MinValue' and 'MaxValue' field.

**Remarks**

To determine the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) 'MinValue' and 'MaxValue' are required as static fields which offer [IConvertible](https://learn.microsoft.com/dotnet/api/system.iconvertible) values.

#### Of(OpcNodeId)

<span class="api-meta">static · since v2.10</span>

Determines the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) of the type identified by the specified `typeId`.

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

```csharp
public static OpcValueRange Of(OpcNodeId typeId)
```

</div>

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

```vbnet
Public Shared Function [Of](typeId As OpcNodeId) As OpcValueRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `typeId` | [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 [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) its underlying [Type](https://learn.microsoft.com/dotnet/api/system.type) is reflected to look up a 'MinValue' and a 'MaxValue' field to determine the [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) values of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) to determine. |

**Returns**

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

The [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) with the according 'MinValue' for [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and the 'MaxValue' for [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) or a null reference (Nothing in Visual Basic) if the according [Type](https://learn.microsoft.com/dotnet/api/system.type) identified by the `typeId` specified does not provide a 'MinValue' and 'MaxValue' field or `typeId` is a null reference (Nothing in Visual Basic) or is a null identifier (see [IsNull](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/members#isnull)).

**Remarks**

To determine the according [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) 'MinValue' and 'MaxValue' are required as static fields which offer [IConvertible](https://learn.microsoft.com/dotnet/api/system.iconvertible) values.

### ToString

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

Returns a string that represents the current [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/).

<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 [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) including the used [Low](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#low) and [High](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/members#high) limits of the range represented.

**Overrides**

[ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Operators

### Explicit

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

Converts a [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) to an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr> object.

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

```csharp
public static explicit operator Range(OpcValueRange value)
```

</div>

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

```vbnet
Public Shared Narrowing Operator CType(value As OpcValueRange) As Range
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) | A [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) that represents the engineering unit information. |

**Returns**

<abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr>

An instance of the <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr> class initialized from the `value`.

### Implicit

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

Converts a <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr> to an [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) object.

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

```csharp
public static implicit operator OpcValueRange(Range value)
```

</div>

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

```vbnet
Public Shared Widening Operator CType(value As Range) As OpcValueRange
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `value` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr> | A <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.Range">Range</abbr> that represents the engineering unit information. |

**Returns**

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

An instance of the [OpcValueRange](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluerange/) class initialized from the `value`.
