# OpcReadEventHistoryDetails Members

> Reference: Defines the time domain, number of events and additional criteria to use to select events from historical database for one or more nodes.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcReadEventHistoryDetails</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

### OpcReadEventHistoryDetails

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

| Overload | Description |
|---|---|
| [OpcReadEventHistoryDetails(int, OpcEventFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#opcreadeventhistorydetails-system-int32-opc-uafx-opceventfilter)<span class="api-meta">since v2.54</span> | Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `numberOfEvents` to select the historical events. |
| [OpcReadEventHistoryDetails(DateTime?, int, OpcEventFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#opcreadeventhistorydetails-system-nullable-of-system-datetime-system-int32-opc-uafx-opceventfilter)<span class="api-meta">since v2.54</span> | Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime` and `numberOfEvents` to use to select the historical events. |
| [OpcReadEventHistoryDetails(DateTime?, DateTime?, int, OpcEventFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#opcreadeventhistorydetails-system-nullable-of-system-datetime-system-nullable-of-system-datetime-system-int32-opc-uafx-opceventfilter)<span class="api-meta">since v2.54</span> | Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime`, `endTime` and `numberOfEvents` to use to select the historical events. |
| [OpcReadEventHistoryDetails(DateTime?, DateTime?, OpcEventFilter)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#opcreadeventhistorydetails-system-nullable-of-system-datetime-system-nullable-of-system-datetime-opc-uafx-opceventfilter)<span class="api-meta">since v2.54</span> | Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime` and `endTime` to use to select the historical events. |

**Exceptions (all overloads)**

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

#### OpcReadEventHistoryDetails(int, OpcEventFilter)

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

Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `numberOfEvents` to select the historical events.

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

```csharp
public OpcReadEventHistoryDetails(int numberOfEvents, OpcEventFilter filter)
```

</div>

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

```vbnet
Public Sub New(numberOfEvents As Integer, filter As OpcEventFilter)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `numberOfEvents` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum number of events returned for any node over the time range. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `numberOfEvents` is lower or equals zero. |

#### OpcReadEventHistoryDetails(DateTime?, int, OpcEventFilter)

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

Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime` and `numberOfEvents` to use to select the historical events.

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

```csharp
public OpcReadEventHistoryDetails(
    DateTime? startTime,
    int numberOfEvents,
    OpcEventFilter filter)
```

</div>

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

```vbnet
Public Sub New(
    startTime As Date?,
    numberOfEvents As Integer,
    filter As OpcEventFilter)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The beginning of the period to read. |
| `numberOfEvents` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum number of events returned for any node over the time range. If only one time is specified, the time range shall extend to return this number of events. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `startTime` is a null reference (Nothing in Visual Basic) or equals [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue). |
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `numberOfEvents` is lower or equals zero. |

#### OpcReadEventHistoryDetails(DateTime?, DateTime?, int, OpcEventFilter)

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

Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime`, `endTime` and `numberOfEvents` to use to select the historical events.

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

```csharp
public OpcReadEventHistoryDetails(
    DateTime? startTime,
    DateTime? endTime,
    int numberOfEvents,
    OpcEventFilter filter)
```

</div>

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

```vbnet
Public Sub New(
    startTime As Date?,
    endTime As Date?,
    numberOfEvents As Integer,
    filter As OpcEventFilter)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The beginning of the period to read or a null reference (Nothing in Visual Basic) if no specific start time is specified. If `startTime` is not specified and the `numberOfEvents` is equals zero the `endTime` needs to be specified. |
| `endTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The end of the period to read or a null reference (Nothing in Visual Basic) if no specific end time is specified. If `endTime` is not specified and the `numberOfEvents` is equals zero the `startTime` needs to be specified. |
| `numberOfEvents` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The maximum number of events returned for any node over the time range. If only one time is specified, the time range shall extend to return this number of events. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `startTime` and `endTime` are a null reference (Nothing in Visual Basic) or are equals [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue) and `numberOfEvents` is lower or equals zero. |

#### OpcReadEventHistoryDetails(DateTime?, DateTime?, OpcEventFilter)

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

Initializes a new instance of the [OpcReadEventHistoryDetails](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/) class using the specified `startTime` and `endTime` to use to select the historical events.

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

```csharp
public OpcReadEventHistoryDetails(
    DateTime? startTime,
    DateTime? endTime,
    OpcEventFilter filter)
```

</div>

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

```vbnet
Public Sub New(startTime As Date?, endTime As Date?, filter As OpcEventFilter)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The beginning of the period to read or a null reference (Nothing in Visual Basic) if no specific start time is specified. If `startTime` is not specified the `endTime` needs to be specified. |
| `endTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The end of the period to read or a null reference (Nothing in Visual Basic) if no specific end time is specified. If `endTime` is not specified the `startTime` needs to be specified. |
| `filter` | [OpcEventFilter](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventfilter/) |  |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `startTime` and `endTime` are a null reference (Nothing in Visual Basic) or are equals [MinValue](https://learn.microsoft.com/dotnet/api/system.datetime.minvalue). |

## Properties

### EndTime

Gets or sets the end of the period to read.

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

```csharp
public DateTime? EndTime { get; set; }
```

</div>

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

```vbnet
Public Property EndTime 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) of the end of the period to read or a null reference (Nothing in Visual Basic) if no specific end time is specified.

**Remarks**

If [EndTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#endtime) is not specified and [NumberOfEvents](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#numberofevents) is equals zero the [StartTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#starttime) needs to be specified.

### Filter

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

```csharp
public OpcEventFilter Filter { get; set; }
```

</div>

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

```vbnet
Public Property Filter As OpcEventFilter
```

</div>

**Property value**

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

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) |  |

### NumberOfEvents

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

Gets or sets the maximum number of events returned for any node over the time range.

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

```csharp
public int NumberOfEvents { get; set; }
```

</div>

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

```vbnet
Public Property NumberOfEvents As Integer
```

</div>

**Property value**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

The maximum number of events returned over the time range. The default value is zero and indicates that there is no maximum.

**Remarks**

If only time (either [StartTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#starttime) or [EndTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#endtime)) is specified, the time range shall extend to return this number of events.

### StartTime

Gets or sets the beginning of the period to read.

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

```csharp
public DateTime? StartTime { get; set; }
```

</div>

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

```vbnet
Public Property StartTime 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) of the beginning of the period read or a null reference (Nothing in Visual Basic) if no specific start time is specified.

**Remarks**

If [StartTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#starttime) is not specified the [EndTime](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcreadeventhistorydetails/members#endtime) needs to be specified.
