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
| Overload | Description |
|---|---|
| Opc | Initializes a new instance of the Opc |
| Opc | Initializes a new instance of the Opccapacity specified. |
| Opc | Initializes a new instance of the Opcvalues specified. |
| Opc | Initializes a new instance of the Opccapacity and values specified. |
OpcModifiedNodeHistory()
Initializes a new instance of the OpcModifiedNodeHistory class whose Capacity is -1 (unlimited).
public OpcModifiedNodeHistory()Public Sub New()OpcModifiedNodeHistory(int)
Initializes a new instance of the OpcModifiedNodeHistory class using the capacity specified.
public OpcModifiedNodeHistory(int capacity)Public Sub New(capacity As Integer)Parameters
| Name | Type | Description |
|---|---|---|
capacity | Int32 | The maximum number of values the history keeps: -1 ( |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The capacity is 0 or less than -1. |
OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue>)
Initializes a new instance of the OpcModifiedNodeHistory class using the values specified.
public OpcModifiedNodeHistory(IEnumerable<OpcModifiedHistoryValue> values)Public Sub New(values As IEnumerable(Of OpcModifiedHistoryValue))Parameters
| Name | Type | Description |
|---|---|---|
values | IEnumerable<Opc | A sequence of the values to add to the history. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The values or one of its items is a null reference ( |
OpcModifiedNodeHistory(int, IEnumerable<OpcModifiedHistoryValue>)
Initializes a new instance of the OpcModifiedNodeHistory class using the capacity and values specified.
public OpcModifiedNodeHistory(
int capacity,
IEnumerable<OpcModifiedHistoryValue> values)Public Sub New(
capacity As Integer,
values As IEnumerable(Of OpcModifiedHistoryValue))Parameters
| Name | Type | Description |
|---|---|---|
capacity | Int32 | The maximum number of values the history keeps: -1 ( |
values | IEnumerable<Opc | A sequence of the values to add to the history. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The values or one of its items is a null reference ( |
| Argument | The 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.
public int Capacity { get; }Public ReadOnly Property Capacity As IntegerProperty value
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.
public int Count { get; }Public ReadOnly Property Count As IntegerProperty value
The number of values, counting each modification of a value.
EnableRaisingEvents
Gets or sets a value indicating whether the history raises its events.
public bool EnableRaisingEvents { get; set; }Public Property EnableRaisingEvents As BooleanProperty value
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.
public DateTime? EndTime { get; }Public ReadOnly Property EndTime As Date?Property value
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.
public DateTime? StartTime { get; }Public ReadOnly Property StartTime As Date?Property value
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.
public void Add(OpcModifiedHistoryValue value)Public Sub Add(value As OpcModifiedHistoryValue)Parameters
| Name | Type | Description |
|---|---|---|
value | Opc | The value to add. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The value is a null reference ( |
Remarks
A value whose timestamp is already in the history is added as a further modification of the value at that time.
AddRange
| Overload | Description |
|---|---|
| AddRange( | Adds the values specified to the history. |
| AddRange( | Adds the values specified to the history. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The values or one of its items is a null reference ( |
AddRange(IEnumerable<OpcModifiedHistoryValue>)
Adds the values specified to the history.
public void AddRange(IEnumerable<OpcModifiedHistoryValue> values)Public Sub AddRange(values As IEnumerable(Of OpcModifiedHistoryValue))Parameters
| Name | Type | Description |
|---|---|---|
values | IEnumerable<Opc | 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.
public void AddRange(params OpcModifiedHistoryValue[] values)Public Sub AddRange(ParamArray values As OpcModifiedHistoryValue())Parameters
| Name | Type | Description |
|---|---|---|
values | params Opc | 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.
public void Clear()Public Sub Clear()Contains
Determines whether the history contains a value with the timestamp specified.
public bool Contains(DateTime timestamp)Public Function Contains(timestamp As Date) As BooleanParameters
| Name | Type | Description |
|---|---|---|
timestamp | DateTime | The timestamp of the value. |
Returns
The value true if the history contains at least one value with the timestamp; otherwise the value false.
Enumerate
| Overload | Description |
|---|---|
| Enumerate() | Gets the values of the history in their sort order. |
| Enumerate( | Gets the values whose timestamp is not earlier than the startTime specified. |
| Enumerate( | 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.
public IEnumerable<OpcModifiedHistoryValue> Enumerate()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.
public IEnumerable<OpcModifiedHistoryValue> Enumerate(DateTime? startTime)Public Function Enumerate(
startTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)Parameters
| Name | Type | Description |
|---|---|---|
startTime | Nullable<DateTime> | The earliest timestamp of the values to get. A null reference ( |
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.
public IEnumerable<OpcModifiedHistoryValue> Enumerate(
DateTime? startTime,
DateTime? endTime)Public Function Enumerate(
startTime As Date?,
endTime As Date?) As IEnumerable(Of OpcModifiedHistoryValue)Parameters
| Name | Type | Description |
|---|---|---|
startTime | Nullable<DateTime> | One bound of the time range. A null reference ( |
endTime | Nullable<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.
public IEnumerator<OpcModifiedHistoryValue> GetEnumerator()Public Function GetEnumerator() As IEnumerator(Of OpcModifiedHistoryValue)Returns
IEnumerator<OpcModifiedHistoryValue>
An enumerator of a snapshot of the history.
Implements
GetValues
Gets the values with the timestamp specified.
public IEnumerable<OpcModifiedHistoryValue> GetValues(DateTime timestamp)Public Function GetValues(
timestamp As Date) As IEnumerable(Of OpcModifiedHistoryValue)Parameters
| Name | Type | Description |
|---|---|---|
timestamp | DateTime | The 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
Raises the Added event.
protected virtual void OnAdded(
OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)Protected Overridable Sub OnAdded(
e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
OnRemoved
Raises the Removed event.
protected virtual void OnRemoved(
OpcNodeHistoryEventArgs<OpcModifiedHistoryValue> e)Protected Overridable Sub OnRemoved(
e As OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))Parameters
| Name | Type | Description |
|---|---|---|
e | Opc | The event data. |
RemoveAt
Removes the value at the index specified.
public void RemoveAt(int index)Public Sub RemoveAt(index As Integer)Parameters
| Name | Type | Description |
|---|---|---|
index | Int32 | The zero-based index of the value in the sort order of the history. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The index is less than zero or not less than Count. |
RemoveRange
| Overload | Description |
|---|---|
| RemoveRange( | Removes the values whose timestamp is not earlier than the startTime specified. |
| RemoveRange( | 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.
public void RemoveRange(DateTime? startTime)Public Sub RemoveRange(startTime As Date?)Parameters
| Name | Type | Description |
|---|---|---|
startTime | Nullable<DateTime> | The earliest timestamp of the values to remove. A null reference ( |
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.
public void RemoveRange(DateTime? startTime, DateTime? endTime)Public Sub RemoveRange(startTime As Date?, endTime As Date?)Parameters
| Name | Type | Description |
|---|---|---|
startTime | Nullable<DateTime> | One bound of the time range. A null reference ( |
endTime | Nullable<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.
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> AddedPublic 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.
public event EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>> RemovedPublic Event Removed As EventHandler(Of OpcNodeHistoryEventArgs(Of OpcModifiedHistoryValue))Event type
EventHandler<OpcNodeHistoryEventArgs<OpcModifiedHistoryValue>>
Indexers
Item
Gets the value at the index specified.
public OpcModifiedHistoryValue this[int index] { get; }Public ReadOnly Default Property this[](
index As Integer) As OpcModifiedHistoryValueParameters
| Name | Type | Description |
|---|---|---|
index | Int32 | The zero-based index of the value in the sort order of the history. |
Property value
The value at the index.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The index is less than zero or not less than Count. |

