Skip to content

Reference

OpcHistoryValue Members

Represents a value of the history of a node.

Reference

OpcHistoryValue Members ​

Type
OpcHistoryValue
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Inherits members from OpcValue.

Constructors ​

OpcHistoryValue ​

3 overloads

OverloadDescription
OpcHistoryValue(object, DateTime)Initializes a new instance of the OpcHistoryValue class using the value and timestamp specified.
OpcHistoryValue(object, DateTime, OpcStatus)Initializes a new instance of the OpcHistoryValue class using the value, timestamp and status specified.
OpcHistoryValue(object, DateTime, OpcStatusCode)Initializes a new instance of the OpcHistoryValue class using the value, timestamp and statusCode specified.

OpcHistoryValue(object, DateTime) ​

Initializes a new instance of the OpcHistoryValue class using the value and timestamp specified.

csharp
public OpcHistoryValue(object value, DateTime timestamp)
vbnet
Public Sub New(value As Object, timestamp As Date)

Parameters

NameTypeDescription
valueObjectThe value.
timestampDateTimeThe time of the value, which is used as the source and the server timestamp.

OpcHistoryValue(object, DateTime, OpcStatus) ​

Initializes a new instance of the OpcHistoryValue class using the value, timestamp and status specified.

csharp
public OpcHistoryValue(object value, DateTime timestamp, OpcStatus status)
vbnet
Public Sub New(value As Object, timestamp As Date, status As OpcStatus)

Parameters

NameTypeDescription
valueObjectThe value.
timestampDateTimeThe time of the value, which is used as the source and the server timestamp.
statusOpcStatusThe status of the value.

OpcHistoryValue(object, DateTime, OpcStatusCode) ​

Initializes a new instance of the OpcHistoryValue class using the value, timestamp and statusCode specified.

csharp
[CLSCompliant(false)]
public OpcHistoryValue(
    object value,
    DateTime timestamp,
    OpcStatusCode statusCode)
vbnet
<CLSCompliant(False)>
Public Sub New(value As Object, timestamp As Date, statusCode As OpcStatusCode)

Parameters

NameTypeDescription
valueObjectThe value.
timestampDateTimeThe time of the value, which is used as the source timestamp.
statusCodeOpcStatusCodeThe status code of the value.

Remarks

Unlike the other constructors, this constructor sets the source timestamp only; the server timestamp remains unset.

Properties ​

Timestamp ​

virtual

Gets the time of the value, by which the history is ordered.

csharp
public virtual DateTime Timestamp { get; }
vbnet
Public Overridable ReadOnly Property Timestamp As Date

Property value

DateTime

The ServerTimestamp or, if it is not set, the SourceTimestamp; MinValue if neither is set.

Methods ​

CompareTo ​

Compares the current OpcHistoryValue with another OpcHistoryValue.

csharp
public int CompareTo(OpcHistoryValue other)
vbnet
Public Function CompareTo(other As OpcHistoryValue) As Integer

Parameters

NameTypeDescription
otherOpcHistoryValueThe OpcHistoryValue to compare with this OpcHistoryValue.

Returns

Int32

A 32-bit signed integer that indicates the relative order of the objects being compared (CompareTo(T)).

Create ​

static · 2 overloads

OverloadDescription
Create(OpcValue)staticCreates an OpcHistoryValue from the value specified.
Create<T>(OpcVariableValue<T>)staticCreates an OpcHistoryValue from the value of a variable node.

Exceptions (all overloads)

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

Create(OpcValue) ​

static

Creates an OpcHistoryValue from the value specified.

csharp
public static OpcHistoryValue Create(OpcValue value)
vbnet
Public Shared Function Create(value As OpcValue) As OpcHistoryValue

Parameters

NameTypeDescription
valueOpcValueThe value providing the data of the history value.

Returns

OpcHistoryValue

An OpcHistoryValue holding the data of the value.

Remarks

The history value uses a copy of the data of the value, so that a change of one value does not change the other.

Create<T>(OpcVariableValue<T>) ​

static

Creates an OpcHistoryValue from the value of a variable node.

csharp
public static OpcHistoryValue Create<T>(OpcVariableValue<T> value)
vbnet
Public Shared Function Create(Of T)(
    value As OpcVariableValue(Of T)) As OpcHistoryValue

Type parameters

NameDescription
TThe type of the value.

Parameters

NameTypeDescription
valueOpcVariableValue<T>The value of the variable node.

Returns

OpcHistoryValue

An OpcHistoryValue using the value, the status and the timestamp of the value, or the current time (UTC) if it has no timestamp.

CreateModified ​

6 overloads

OverloadDescription
CreateModified(OpcHistoryModificationType)Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType specified at the current time (UTC).
CreateModified(OpcHistoryModificationType, string)Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType by the userName specified at the current time (UTC).
CreateModified(OpcHistoryModificationType, string, DateTime)Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType by the userName at the timestamp specified.
CreateModified(OpcHistoryModificationType, string, DateTime, object)Creates an OpcModifiedHistoryValue from this value using the value and a modification of the modificationType by the userName at the timestamp specified.
CreateModified(OpcHistoryModificationInfo)Creates an OpcModifiedHistoryValue from this value using the modificationInfo specified.
CreateModified(OpcHistoryModificationInfo, object)Creates an OpcModifiedHistoryValue from this value using the modificationInfo and the value specified.

CreateModified(OpcHistoryModificationType) ​

Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType specified at the current time (UTC).

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationType modificationType)
vbnet
Public Function CreateModified(
    modificationType As OpcHistoryModificationType) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationTypeOpcHistoryModificationTypeThe kind of the modification.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding the data of this value.

Remarks

The modified value shares the data of this value, so that a change of the data of one value also changes the data of the other.

CreateModified(OpcHistoryModificationType, string) ​

Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType by the userName specified at the current time (UTC).

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationType modificationType,
    string userName)
vbnet
Public Function CreateModified(
    modificationType As OpcHistoryModificationType,
    userName As String) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationTypeOpcHistoryModificationTypeThe kind of the modification.
userNameStringThe name of the user who made the modification.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding the data of this value.

Remarks

The modified value shares the data of this value, so that a change of the data of one value also changes the data of the other.

CreateModified(OpcHistoryModificationType, string, DateTime) ​

Creates an OpcModifiedHistoryValue from this value using a modification of the modificationType by the userName at the timestamp specified.

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationType modificationType,
    string userName,
    DateTime timestamp)
vbnet
Public Function CreateModified(
    modificationType As OpcHistoryModificationType,
    userName As String,
    timestamp As Date) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationTypeOpcHistoryModificationTypeThe kind of the modification.
userNameStringThe name of the user who made the modification.
timestampDateTimeThe time of the modification.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding the data of this value.

Remarks

The modified value shares the data of this value, so that a change of the data of one value also changes the data of the other.

CreateModified(OpcHistoryModificationType, string, DateTime, object) ​

Creates an OpcModifiedHistoryValue from this value using the value and a modification of the modificationType by the userName at the timestamp specified.

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationType modificationType,
    string userName,
    DateTime timestamp,
    object value)
vbnet
Public Function CreateModified(
    modificationType As OpcHistoryModificationType,
    userName As String,
    timestamp As Date,
    value As Object) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationTypeOpcHistoryModificationTypeThe kind of the modification.
userNameStringThe name of the user who made the modification.
timestampDateTimeThe time of the modification.
valueObjectThe value of the modified value.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding a copy of the data of this value with the value specified.

Remarks

The status and the timestamps of the modified value are those of this value. This value remains unchanged.

CreateModified(OpcHistoryModificationInfo) ​

Creates an OpcModifiedHistoryValue from this value using the modificationInfo specified.

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationInfo modificationInfo)
vbnet
Public Function CreateModified(
    modificationInfo As OpcHistoryModificationInfo) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationInfoOpcHistoryModificationInfoThe information about the modification.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding the data of this value.

Exceptions

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

Remarks

The modified value shares the data of this value, so that a change of the data of one value also changes the data of the other.

CreateModified(OpcHistoryModificationInfo, object) ​

Creates an OpcModifiedHistoryValue from this value using the modificationInfo and the value specified.

csharp
public OpcModifiedHistoryValue CreateModified(
    OpcHistoryModificationInfo modificationInfo,
    object value)
vbnet
Public Function CreateModified(
    modificationInfo As OpcHistoryModificationInfo,
    value As Object) As OpcModifiedHistoryValue

Parameters

NameTypeDescription
modificationInfoOpcHistoryModificationInfoThe information about the modification.
valueObjectThe value of the modified value.

Returns

OpcModifiedHistoryValue

An OpcModifiedHistoryValue holding a copy of the data of this value with the value specified.

Exceptions

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

Remarks

The status and the timestamps of the modified value are those of this value. This value remains unchanged.

Equals ​

2 overloads

OverloadDescription
Equals(object)overrideDetermines whether the specified other is equal to this OpcHistoryValue.
Equals(OpcHistoryValue)Determines whether the specified other is equal to this OpcHistoryValue.

Equals(object) ​

override

Determines whether the specified other is equal to this OpcHistoryValue.

csharp
public override bool Equals(object other)
vbnet
Public Overrides Function Equals(other As Object) As Boolean

Parameters

NameTypeDescription
otherObjectThe OpcHistoryValue to compare to the current OpcHistoryValue.

Returns

Boolean

The value true if the specified OpcHistoryValue is equal to the current OpcHistoryValue; otherwise the value false.

Overrides

Equals

Equals(OpcHistoryValue) ​

Determines whether the specified other is equal to this OpcHistoryValue.

csharp
public bool Equals(OpcHistoryValue other)
vbnet
Public Function Equals(other As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
otherOpcHistoryValueThe OpcHistoryValue to compare to the current OpcHistoryValue.

Returns

Boolean

The value true if the specified OpcHistoryValue is equal to the current OpcHistoryValue; otherwise the value false.

GetHashCode ​

override

Retrieves a hash code for this OpcHistoryValue.

csharp
public override int GetHashCode()
vbnet
Public Overrides Function GetHashCode() As Integer

Returns

Int32

An int that contains the hash code for the OpcHistoryValue.

Overrides

GetHashCode

ToString ​

override · 2 overloads

OverloadDescription
ToString()overrideReturns a string that represents the history value.
ToString(string, IFormatProvider)overrideReturns a string that represents the history value using the format and formatProvider specified.

ToString() ​

override

Returns a string that represents the history value.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

A string containing the Timestamp and the string representation of the value.

Overrides

ToString

ToString(string, IFormatProvider) ​

override

Returns a string that represents the history value using the format and formatProvider specified.

csharp
public override string ToString(string format, IFormatProvider formatProvider)
vbnet
Public Overrides Function ToString(
    format As String,
    formatProvider As IFormatProvider) As String

Parameters

NameTypeDescription
formatStringThe format to use for the value.
formatProviderIFormatProviderThe provider to use to format the value.

Returns

String

A string containing the Timestamp and the formatted value.

Overrides

ToString

Operators ​

Equality ​

static

Returns a value indicating whether two instance of OpcHistoryValue are equal.

csharp
public static bool operator ==(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator =(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue to compare.
rightOpcHistoryValueThe second OpcHistoryValue to compare.

Returns

Boolean

The value true if left and right are equal; otherwise the value false.

GreaterThan ​

static

Determines whether the first specified OpcHistoryValue object is greater than the second specified OpcHistoryValue object.

csharp
public static bool operator >(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator >(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue object.
rightOpcHistoryValueThe second OpcHistoryValue object.

Returns

Boolean

The value true if left is greater than right; otherwise, false.

GreaterThanOrEqual ​

static

Determines whether the first specified OpcHistoryValue object is greater than or equal to the second specified OpcHistoryValue object.

csharp
public static bool operator >=(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator >=(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue object.
rightOpcHistoryValueThe second OpcHistoryValue object.

Returns

Boolean

The value true if left is greater than or equal to right; otherwise, false.

Inequality ​

static

Returns a value indicating whether two instances of OpcHistoryValue are not equal.

csharp
public static bool operator !=(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator <>(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue to compare.
rightOpcHistoryValueThe second OpcHistoryValue to compare.

Returns

Boolean

The value true if left and right are not equal; otherwise the value false.

LessThan ​

static

Determines whether the first specified OpcHistoryValue object is less than the second specified OpcHistoryValue object.

csharp
public static bool operator <(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator <(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue object.
rightOpcHistoryValueThe second OpcHistoryValue object.

Returns

Boolean

The value true if left is less than right; otherwise the value false.

Exceptions

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

LessThanOrEqual ​

static

Determines whether the first specified OpcHistoryValue object is less than or equal to the second OpcHistoryValue object.

csharp
public static bool operator <=(OpcHistoryValue left, OpcHistoryValue right)
vbnet
Public Shared Operator <=(
    left As OpcHistoryValue,
    right As OpcHistoryValue) As Boolean

Parameters

NameTypeDescription
leftOpcHistoryValueThe first OpcHistoryValue object.
rightOpcHistoryValueThe second OpcHistoryValue object.

Returns

Boolean

The value true if left is less than or equal to right; otherwise the value false.

Exceptions

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