# IOpcNodeHistoryProvider Members

> Reference: Defines an interface which is to be used by an OpcNodeManager to provide and maintain historical values for an OpcVariableNode.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcNodeHistoryProvider</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Properties

### Node

Gets the [OpcVariableNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablenode/) for which this instance provides and maintains historical values.

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

```csharp
OpcVariableNode Node { get; }
```

</div>

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

```vbnet
ReadOnly Property Node As OpcVariableNode
```

</div>

**Property value**

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

An instance of the [OpcVariableNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvariablenode/) class this provider is responsible for.

## Methods

### CreateHistory

Creates the history entries of the `values` specified.

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

```csharp
OpcStatusCollection CreateHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    OpcValueCollection values)
```

</div>

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

```vbnet
Function CreateHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    values As OpcValueCollection) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `values` | [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) | The [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) with the values to create. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the result per value, which the server returns to the client.

### DeleteHistory

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

| Overload | Description |
|---|---|
| [DeleteHistory(OpcContext, OpcHistoryModificationInfo, IEnumerable&lt;DateTime&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.iopcnodehistoryprovider/members#deletehistory-opc-uafx-opccontext-opc-uafx-opchistorymodificationinfo-system-collections-generic-ienumerable-of-system-datetime) | Deletes the history entries at the `times` specified. |
| [DeleteHistory(OpcContext, OpcHistoryModificationInfo, OpcValueCollection)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.iopcnodehistoryprovider/members#deletehistory-opc-uafx-opccontext-opc-uafx-opchistorymodificationinfo-opc-uafx-opcvaluecollection) | Deletes the history entries of the `values` specified. |
| [DeleteHistory(OpcContext, OpcHistoryModificationInfo, DateTime?, DateTime?, OpcDeleteHistoryOptions)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.iopcnodehistoryprovider/members#deletehistory-opc-uafx-opccontext-opc-uafx-opchistorymodificationinfo-system-nullable-of-system-datetime-system-nullable-of-system-datetime-opc-uafx-server-opcdeletehistoryoptions) | Deletes the history entries within the time range specified. |

#### DeleteHistory(OpcContext, OpcHistoryModificationInfo, IEnumerable&lt;DateTime&gt;)

Deletes the history entries at the `times` specified.

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

```csharp
OpcStatusCollection DeleteHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    IEnumerable<DateTime> times)
```

</div>

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

```vbnet
Function DeleteHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    times As IEnumerable(Of Date)) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `times` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | A sequence of the timestamps of the entries to delete. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the result per timestamp, which the server returns to the client.

#### DeleteHistory(OpcContext, OpcHistoryModificationInfo, OpcValueCollection)

Deletes the history entries of the `values` specified.

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

```csharp
OpcStatusCollection DeleteHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    OpcValueCollection values)
```

</div>

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

```vbnet
Function DeleteHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    values As OpcValueCollection) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `values` | [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) | The [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) with the values whose entries are to be deleted. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the result per value, which the server returns to the client.

#### DeleteHistory(OpcContext, OpcHistoryModificationInfo, DateTime?, DateTime?, OpcDeleteHistoryOptions)

Deletes the history entries within the time range specified.

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

```csharp
OpcStatusCollection DeleteHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    DateTime? startTime,
    DateTime? endTime,
    OpcDeleteHistoryOptions options)
```

</div>

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

```vbnet
Function DeleteHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    startTime As Date?,
    endTime As Date?,
    options As OpcDeleteHistoryOptions) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The begin of the time range or a null reference (Nothing in Visual Basic) if the range is not limited at its begin. |
| `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 time range or a null reference (Nothing in Visual Basic) if the range is not limited at its end. |
| `options` | [OpcDeleteHistoryOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdeletehistoryoptions/) | A combination of the [OpcDeleteHistoryOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcdeletehistoryoptions/) flags which specify the entries to delete. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the results of the operation, which the server returns to the client.

### ReadHistory

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

Reads the history of the values within the time range specified.

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

```csharp
IEnumerable<OpcHistoryValue> ReadHistory(
    OpcContext context,
    DateTime? startTime,
    DateTime? endTime,
    bool timeFlowsBackward,
    uint? maxCount,
    OpcReadHistoryOptions options)
```

</div>

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

```vbnet
Function ReadHistory(
    context As OpcContext,
    startTime As Date?,
    endTime As Date?,
    timeFlowsBackward As Boolean,
    maxCount As UInteger?,
    options As OpcReadHistoryOptions) As IEnumerable(Of OpcHistoryValue)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the read operation. |
| `startTime` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[DateTime](https://learn.microsoft.com/dotnet/api/system.datetime)&gt; | The begin of the time range to read or a null reference (Nothing in Visual Basic) if the range is not limited at its begin. |
| `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 time range to read or a null reference (Nothing in Visual Basic) if the range is not limited at its end. |
| `timeFlowsBackward` | [Boolean](https://learn.microsoft.com/dotnet/api/system.boolean) | The value true to provide the values in descending order of their timestamps; otherwise the value false to provide them in ascending order. |
| `maxCount` | [Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)&gt; | The maximum number of values the server uses or a null reference (Nothing in Visual Basic) if the number is not limited. A provider can use it to optimize reading. |
| `options` | [OpcReadHistoryOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcreadhistoryoptions/) | A combination of the [OpcReadHistoryOptions](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcreadhistoryoptions/) flags which specify the values to provide. |

**Returns**

[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[OpcHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistoryvalue/)&gt;

A sequence of the [OpcHistoryValue](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistoryvalue/) instances read.

**Remarks**

The server does not swap the bounds of the time range, so that the `startTime` can be later than the `endTime`, e.g. when a client reads backward in time.

### ReplaceHistory

Replaces the existing history entries with the `values` specified.

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

```csharp
OpcStatusCollection ReplaceHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    OpcValueCollection values)
```

</div>

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

```vbnet
Function ReplaceHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    values As OpcValueCollection) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `values` | [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) | The [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) with the values to replace the existing entries with. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the result per value, which the server returns to the client.

### UpdateHistory

Updates the history entries of the `values` specified.

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

```csharp
OpcStatusCollection UpdateHistory(
    OpcContext context,
    OpcHistoryModificationInfo modificationInfo,
    OpcValueCollection values)
```

</div>

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

```vbnet
Function UpdateHistory(
    context As OpcContext,
    modificationInfo As OpcHistoryModificationInfo,
    values As OpcValueCollection) As OpcStatusCollection
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) of the operation. |
| `modificationInfo` | [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) | The [OpcHistoryModificationInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opchistorymodificationinfo/) which describes the modification. |
| `values` | [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) | The [OpcValueCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcvaluecollection/) with the values to create or to replace the existing entries with. |

**Returns**

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

An [OpcStatusCollection](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatuscollection/) with the result per value, which the server returns to the client.
