Skip to content

Reference

OpcModifiedNodeHistory Members

Represents the modified history of a node: the values which have been inserted, replaced, updated or deleted, each together with the information about its modification.

Reference

OpcModifiedNodeHistory Members ​

Type
OpcModifiedNodeHistory
Namespace
Opc.UaFx.Server
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Constructors ​

OpcModifiedNodeHistory ​

4 overloads

OverloadDescription
OpcModifiedNodeHistory()Initializes a new instance of the OpcModifiedNodeHistory class whose Capacity is -1 (unlimited).
OpcModifiedNodeHistory(int)Initializes a new instance of the OpcModifiedNodeHistory class using the capacity specified.
OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue>)Initializes a new instance of the OpcModifiedNodeHistory class using the values specified.
OpcModifiedNodeHistory(int, IEnumerable<OpcModifiedHistoryValue>)Initializes a new instance of the OpcModifiedNodeHistory class using the capacity and values specified.

OpcModifiedNodeHistory() ​

Initializes a new instance of the OpcModifiedNodeHistory class whose Capacity is -1 (unlimited).

csharp
public OpcModifiedNodeHistory()
vbnet
Public Sub New()

OpcModifiedNodeHistory(int) ​

Initializes a new instance of the OpcModifiedNodeHistory class using the capacity specified.

csharp
public OpcModifiedNodeHistory(int capacity)
vbnet
Public Sub New(capacity As Integer)

Parameters

NameTypeDescription
capacityInt32The maximum number of values the history keeps: -1 (unlimited) or a positive number.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe capacity is 0 or less than -1.

OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue>) ​

Initializes a new instance of the OpcModifiedNodeHistory class using the values specified.

csharp
public OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue> values)
vbnet
Public Sub New(values As IEnumerable(Of OpcModifiedHistoryValue))

Parameters

NameTypeDescription
valuesIEnumerable<OpcModifiedHistoryValue>A sequence of the values to add to the history.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe values or one of its items is a null reference (Nothing in Visual Basic).

OpcModifiedNodeHistory(int, IEnumerable<OpcModifiedHistoryValue>) ​

Initializes a new instance of the OpcModifiedNodeHistory class using the capacity and values specified.

csharp
public OpcModifiedNodeHistory(
    int capacity,
    IEnumerable<OpcModifiedHistoryValue> values)
vbnet
Public Sub New(
    capacity As Integer,
    values As IEnumerable(Of OpcModifiedHistoryValue))

Parameters

NameTypeDescription
capacityInt32The maximum number of values the history keeps: -1 (unlimited) or a positive number.
valuesIEnumerable<OpcModifiedHistoryValue>A sequence of the values to add to the history.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe values or one of its items is a null reference (Nothing in Visual Basic).
ArgumentOutOfRangeExceptionThe capacity is 0 or less than -1.

Remarks

The values are added like using AddRange, so that a history which reaches its Capacity removes values as described there.

Properties ​

Capacity ​

Gets the maximum number of values the history keeps.

csharp
public int Capacity { get; }
vbnet
Public ReadOnly Property Capacity As Integer

Property value

Int32

The maximum number of values: -1 (unlimited) or a positive number.

Remarks

When a value is added to a history which has reached its capacity, the oldest modification is removed first, regardless of the timestamps of the values: the value with the earliest ModificationTime and, for the same modification time, the value added first. Then the Removed event is raised.

Count ​

Gets the number of values in the history.

csharp
public int Count { get; }
vbnet
Public ReadOnly Property Count As Integer

Property value

Int32

The number of values, counting each modification of a value.

EnableRaisingEvents ​

Gets or sets a value indicating whether the history raises its events.

csharp
public bool EnableRaisingEvents { get; set; }
vbnet
Public Property EnableRaisingEvents As Boolean

Property value

Boolean

The value true to raise the events Added and Removed; otherwise the value false. The default value is true.

EndTime ​

Gets the latest timestamp of the values in the history.

csharp
public DateTime? EndTime { get; }
vbnet
Public ReadOnly Property EndTime As Date?

Property value

Nullable<DateTime>

The timestamp of the last value or a null reference (Nothing in Visual Basic) if the history is empty.

StartTime ​

Gets the earliest timestamp of the values in the history.

csharp
public DateTime? StartTime { get; }
vbnet
Public ReadOnly Property StartTime As Date?

Property value

Nullable<DateTime>

The timestamp of the first value or a null reference (Nothing in Visual Basic) if the history is empty.

Methods ​

Add ​

Adds the value specified to the history.

csharp
public void Add(OpcModifiedHistoryValue value)
vbnet
Public Sub Add(value As OpcModifiedHistoryValue)

Parameters

NameTypeDescription
valueOpcModifiedHistoryValueThe value to add.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe value is a null reference (Nothing in Visual Basic).

Remarks

A value whose timestamp is already in the history is added as a further modification of the value at that time.

AddRange ​

2 overloads

OverloadDescription
AddRange(IEnumerable<OpcModifiedHistoryValue>)Adds the values specified to the history.
AddRange(params OpcModifiedHistoryValue[])Adds the values specified to the history.

Exceptions (all overloads)

ExceptionCondition
ArgumentNullExceptionThe values or one of its items is a null reference (Nothing in Visual Basic).

AddRange(IEnumerable<OpcModifiedHistoryValue>) ​

Adds the values specified to the history.

csharp
public void AddRange(IEnumerable<OpcModifiedHistoryValue> values)
vbnet
Public Sub AddRange(values As IEnumerable(Of OpcModifiedHistoryValue))

Parameters

NameTypeDescription
valuesIEnumerable<OpcModifiedHistoryValue>A sequence of the values to add.

Remarks

No value is added if one of the items is a null reference.

AddRange(params OpcModifiedHistoryValue[]) ​

Adds the values specified to the history.

csharp
public void AddRange(params OpcModifiedHistoryValue[] values)
vbnet
Public Sub AddRange(ParamArray values As OpcModifiedHistoryValue())

Parameters

NameTypeDescription
valuesparams OpcModifiedHistoryValue[]The values to add.

Remarks

No value is added if one of the items is a null reference.

Clear ​

Removes all values from the history.

csharp
public void Clear()
vbnet
Public Sub Clear()

Contains ​

Determines whether the history contains a value with the timestamp specified.

csharp
public bool Contains(DateTime timestamp)
vbnet
Public Function Contains(timestamp As Date) As Boolean

Parameters

NameTypeDescription
timestampDateTimeThe timestamp of the value.

Returns

Boolean

The value true if the history contains at least one value with the timestamp; otherwise the value false.

Enumerate ​

3 overloads

OverloadDescription
Enumerate()Gets the values of the history in their sort order.
Enumerate(DateTime?)Gets the values whose timestamp is not earlier than the startTime specified.
Enumerate(DateTime?, DateTime?)Gets the values whose timestamp is within the time range specified, including its bounds.

Enumerate() ​

Gets the values of the history in their sort order.

csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate()
vbnet
Public Function Enumerate() As IEnumerable(Of OpcModifiedHistoryValue)

Returns

IEnumerable<OpcModifiedHistoryValue>

A sequence of all values.

Remarks

The sequence is a snapshot of the history.

Enumerate(DateTime?) ​

Gets the values whose timestamp is not earlier than the startTime specified.

csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate(DateTime? startTime)
vbnet
Public Function Enumerate(
    startTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)

Parameters

NameTypeDescription
startTimeNullable<DateTime>The earliest timestamp of the values to get. A null reference (Nothing in Visual Basic), MinValue or MaxValue does not limit the time range.

Returns

IEnumerable<OpcModifiedHistoryValue>

A sequence of the values within the time range.

Remarks

The sequence is a snapshot of the history.

Enumerate(DateTime?, DateTime?) ​

Gets the values whose timestamp is within the time range specified, including its bounds.

csharp
public IEnumerable<OpcModifiedHistoryValue> Enumerate(
    DateTime? startTime,
    DateTime? endTime)
vbnet
Public Function Enumerate(
    startTime As Date?,
    endTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)

Parameters

NameTypeDescription
startTimeNullable<DateTime>One bound of the time range. A null reference (Nothing in Visual Basic), MinValue or MaxValue does not limit the time range.
endTimeNullable<DateTime>The other bound of the time range, with the same values for an unlimited bound as the startTime.

Returns

IEnumerable<OpcModifiedHistoryValue>

A sequence of the values within the time range.

Remarks

If the startTime is later than the endTime, the bounds are swapped. The sequence is a snapshot of the history.

GetEnumerator ​

Returns an enumerator which iterates through the values of the history.

csharp
public IEnumerator<OpcModifiedHistoryValue> GetEnumerator()
vbnet
Public Function GetEnumerator() As IEnumerator(Of OpcModifiedHistoryValue)

Returns

IEnumerator<OpcModifiedHistoryValue>

An enumerator of a snapshot of the history.

Implements

GetEnumerator()

GetValues ​

Gets the values with the timestamp specified.

csharp
public IEnumerable<OpcModifiedHistoryValue> GetValues(DateTime timestamp)
vbnet
Public Function GetValues(
    timestamp As Date) As IEnumerable(Of OpcModifiedHistoryValue)

Parameters

NameTypeDescription
timestampDateTimeThe timestamp of the values.

Returns

IEnumerable<OpcModifiedHistoryValue>

A sequence of the modifications of the value at the timestamp, from the most recent to the oldest modification; an empty sequence if there is no value with the timestamp.

OnAdded ​

protected · virtual

Raises the Added event.

csharp
protected virtual void OnAdded(
    OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)
vbnet
Protected Overridable Sub OnAdded(
    e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))

Parameters

NameTypeDescription
eOpcNodeHistoryEventArgs<OpcModifiedHistoryValue>The event data.

OnRemoved ​

protected · virtual

Raises the Removed event.

csharp
protected virtual void OnRemoved(
    OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)
vbnet
Protected Overridable Sub OnRemoved(
    e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))

Parameters

NameTypeDescription
eOpcNodeHistoryEventArgs<OpcModifiedHistoryValue>The event data.

RemoveAt ​

Removes the value at the index specified.

csharp
public void RemoveAt(int index)
vbnet
Public Sub RemoveAt(index As Integer)

Parameters

NameTypeDescription
indexInt32The zero-based index of the value in the sort order of the history.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe index is less than zero or not less than Count.

RemoveRange ​

2 overloads

OverloadDescription
RemoveRange(DateTime?)Removes the values whose timestamp is not earlier than the startTime specified.
RemoveRange(DateTime?, DateTime?)Removes the values whose timestamp is within the time range specified, including its bounds.

RemoveRange(DateTime?) ​

Removes the values whose timestamp is not earlier than the startTime specified.

csharp
public void RemoveRange(DateTime? startTime)
vbnet
Public Sub RemoveRange(startTime As Date?)

Parameters

NameTypeDescription
startTimeNullable<DateTime>The earliest timestamp of the values to remove. A null reference (Nothing in Visual Basic), MinValue or MaxValue does not limit the time range.

Remarks

The Removed event is raised once for all values removed, also if no value has been removed.

RemoveRange(DateTime?, DateTime?) ​

Removes the values whose timestamp is within the time range specified, including its bounds.

csharp
public void RemoveRange(DateTime? startTime, DateTime? endTime)
vbnet
Public Sub RemoveRange(startTime As Date?, endTime As Date?)

Parameters

NameTypeDescription
startTimeNullable<DateTime>One bound of the time range. A null reference (Nothing in Visual Basic), MinValue or MaxValue does not limit the time range.
endTimeNullable<DateTime>The other bound of the time range, with the same values for an unlimited bound as the startTime.

Remarks

If the startTime is later than the endTime, the bounds are swapped. The Removed event is raised once for all values removed, also if no value has been removed.

Events ​

Added ​

Occurs after values have been added to the history.

csharp
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> Added
vbnet
Public Event Added As EventHandler(Of OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))

Event type

EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>>

Removed ​

Occurs after values have been removed from the history, also if a value has been removed because the history reached its Capacity.

csharp
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> Removed
vbnet
Public Event Removed As EventHandler(Of OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))

Event type

EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>>

Indexers ​

Item ​

Gets the value at the index specified.

csharp
public OpcModifiedHistoryValue this[int index] { get; }
vbnet
Public ReadOnly Default Property this[](
    index As Integer) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
indexInt32The zero-based index of the value in the sort order of the history.

Property value

OpcModifiedHistoryValue

The value at the index.

Exceptions

ExceptionCondition
ArgumentOutOfRangeExceptionThe index is less than zero or not less than Count.