# OpcReadNodesRequest Members

> Reference: Represents the request of the Read service of OPC UA, which reads attributes of nodes.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcReadNodesRequest</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.services">Opc.UaFx.Services</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>

Inherits members from [OpcServiceRequest&lt;OpcReadNode, OpcReadNodeCollection&gt;](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcservicerequest-2/members), [OpcServiceRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcservicerequest/members).

## Constructors

### OpcReadNodesRequest

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

| Overload | Description |
|---|---|
| [OpcReadNodesRequest(IEnumerable&lt;OpcReadNode&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/members#opcreadnodesrequest-system-collections-generic-ienumerable-of-opc-uafx-opcreadnode) | Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `commands` and a new header. |
| [OpcReadNodesRequest(params OpcReadNode\[\])](#opcreadnodesrequest-opc-uafx-opcreadnode-array) | Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `commands` and a new header. |
| [OpcReadNodesRequest(IOpcServiceRequestHeader, IEnumerable&lt;OpcReadNode&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/members#opcreadnodesrequest-opc-uafx-services-iopcservicerequestheader-system-collections-generic-ienumerable-of-opc-uafx-opcreadnode)<span class="api-meta">since v2.7</span> | Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `header` and `commands`. |
| [OpcReadNodesRequest(IOpcServiceRequestHeader, params OpcReadNode\[\])](#opcreadnodesrequest-opc-uafx-services-iopcservicerequestheader-opc-uafx-opcreadnode-array)<span class="api-meta">since v2.7</span> | Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `header` and `commands`. |

#### OpcReadNodesRequest(IEnumerable&lt;OpcReadNode&gt;)

Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `commands` and a new header.

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

```csharp
public OpcReadNodesRequest(IEnumerable<OpcReadNode> commands)
```

</div>

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

```vbnet
Public Sub New(commands As IEnumerable(Of OpcReadNode))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcReadNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadnode/)&gt; | The commands which specify the attributes to read. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` is a null reference (Nothing in Visual Basic). |

#### OpcReadNodesRequest(params OpcReadNode\[\])

Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `commands` and a new header.

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

```csharp
public OpcReadNodesRequest(params OpcReadNode[] commands)
```

</div>

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

```vbnet
Public Sub New(ParamArray commands As OpcReadNode())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `commands` | params [OpcReadNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadnode/)[] | The commands which specify the attributes to read. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `commands` is a null reference (Nothing in Visual Basic). |

#### OpcReadNodesRequest(IOpcServiceRequestHeader, IEnumerable&lt;OpcReadNode&gt;)

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

Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `header` and `commands`.

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

```csharp
public OpcReadNodesRequest(
    IOpcServiceRequestHeader header,
    IEnumerable<OpcReadNode> commands)
```

</div>

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

```vbnet
Public Sub New(
    header As IOpcServiceRequestHeader,
    commands As IEnumerable(Of OpcReadNode))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `header` | [IOpcServiceRequestHeader](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopcservicerequestheader/) | The header of the request. |
| `commands` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcReadNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadnode/)&gt; | The commands which specify the attributes to read. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `header` or the `commands` is a null reference (Nothing in Visual Basic). |

#### OpcReadNodesRequest(IOpcServiceRequestHeader, params OpcReadNode\[\])

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

Initializes a new instance of the [OpcReadNodesRequest](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcreadnodesrequest/) class using the specified `header` and `commands`.

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

```csharp
public OpcReadNodesRequest(
    IOpcServiceRequestHeader header,
    params OpcReadNode[] commands)
```

</div>

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

```vbnet
Public Sub New(
    header As IOpcServiceRequestHeader,
    ParamArray commands As OpcReadNode())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `header` | [IOpcServiceRequestHeader](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.iopcservicerequestheader/) | The header of the request. |
| `commands` | params [OpcReadNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadnode/)[] | The commands which specify the attributes to read. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `header` or the `commands` is a null reference (Nothing in Visual Basic). |

## Properties

### MaxAge

Gets or sets the maximum age in milliseconds of the values to read.

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

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

</div>

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

```vbnet
Public Property MaxAge As Double
```

</div>

**Property value**

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

The maximum age of a value a server may provide from its cache: 0 for a value read from the data source; the default value is 0.

### TimestampsToReturn

Gets or sets which timestamps of the values are to be returned.

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

```csharp
public OpcTimestampsToReturn TimestampsToReturn { get; set; }
```

</div>

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

```vbnet
Public Property TimestampsToReturn As OpcTimestampsToReturn
```

</div>

**Property value**

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

One of the members defined by the [OpcTimestampsToReturn](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctimestampstoreturn/) enumeration; the default value is [Both](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctimestampstoreturn/#both).

## Methods

### Validate

<span class="api-meta">protected · override · since v2.50</span>

Validates the request before a server processes it.

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

```csharp
protected override void Validate()
```

</div>

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

```vbnet
Protected Overrides Sub Validate()
```

</div>

**Overrides**

[Validate](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.services.opcservicerequest/members#validate)

**Remarks**

A server rejects the request with [BadNothingToDo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscode/#badnothingtodo) if it contains no commands; then none of the commands is executed.
