Namespace: Opc.UaFx
Assemblies: Opc.UaFx.Advanced.dll, Opc.UaFx.Advanced.dll
The OpcValue type exposes the following members.
Initializes a new instance of the OpcValue class using the value
, sourceTimestamp
and serverTimestamp
of the value
.
C#
public OpcValue(object value, DateTime sourceTimestamp, DateTime serverTimestamp)
Parameters
value
Object
The value to represent.
sourceTimestamp
DateTime
The timestamp at which the source produced the value
.
serverTimestamp
DateTime
The timestamp at which the server recorded the value
.
Initializes a new instance of the OpcValue class using the value
, sourceTimestamp
, serverTimestamp
and status
of the value
.
C#
public OpcValue(object value, DateTime sourceTimestamp, DateTime serverTimestamp, OpcStatus status)
Parameters
value
Object
The value to represent.
sourceTimestamp
DateTime
The timestamp at which the source produced the value
.
serverTimestamp
DateTime
The timestamp at which the server recorded the value
.
status
OpcStatus
The status information associated with the value
.
Initializes a new instance of the OpcValue class using the value
, sourceTimestamp
, serverTimestamp
and statusCode
of the value
.
C#
[CLSCompliant(false)] public OpcValue(object value, DateTime sourceTimestamp, DateTime serverTimestamp, OpcStatusCode statusCode)
Parameters
value
Object
The value to represent.
sourceTimestamp
DateTime
The timestamp at which the source produced the value
.
serverTimestamp
DateTime
The timestamp at which the server recorded the value
.
statusCode
OpcStatusCode
One of the OpcStatusCode members which defines the status information associated with the value
.
Initializes a new instance of the OpcValue class using the value
, sourceTimestamp
and status
of the value
.
C#
public OpcValue(object value, DateTime sourceTimestamp, OpcStatus status)
Parameters
value
Object
The value to represent.
sourceTimestamp
DateTime
The timestamp at which the source produced the value.
status
OpcStatus
The status information associated with the value
.
Initializes a new instance of the OpcValue class using the value
, sourceTimestamp
and statusCode
of the value
.
C#
[CLSCompliant(false)] public OpcValue(object value, DateTime sourceTimestamp, OpcStatusCode statusCode)
Parameters
value
Object
The value to represent.
sourceTimestamp
DateTime
The timestamp at which the source produced the value.
statusCode
OpcStatusCode
One of the OpcStatusCode members which defines the status information associated with the value
.
Gets the type of value represented.
C#
public OpcDataType DataType { get; }
Property Value
One of the members defined by the OpcDataType. In case there Value is a null reference (Nothing in Visual Basic) Null.
Gets the rank of the value represented.
C#
public int Rank { get; }
Property Value
The rank of the value or -2 in case there is no type information available for the value represented.
Gets or sets the difference between a high resolution timestamp with a resolution of 10 picoseconds and the ServerTimestamp which only has a 100 ns resolution.
C#
public ushort ServerPicoseconds { get; set; }
Property Value
The number of 10 picosecond intervals for the ServerTimestamp.
Remarks
The value should be less than 10 000.
Gets or sets the difference between a high resolution timestamp with a resolution of 10 picoseconds and the SourceTimestamp which only has a 100 ns resolution.
C#
public ushort SourcePicoseconds { get; set; }
Property Value
The number of 10 picosecond intervals for the SourceTimestamp.
Remarks
The value should be less than 10 000.
Gets or sets the timestamp of the source from that the value originates.
C#
public DateTime? SourceTimestamp { get; set; }
Property Value
The timestamp of the source for the value or a null reference (Nothing in Visual Basic) in case there is no timestamp provided by the source of the value.
Gets the status information which defines the servers ability to access/provide the value.
C#
public OpcStatus Status { get; }
Property Value
The status information associated with the value.
Remarks
If the status information indicates an error then the value is to be ignored and the server shall set it to a null reference (Nothing in Visual Basic).
Gets or sets the value represented.
C#
public object Value { get; set; }
Property Value
The value associated with the metadata represented.
Retrieves the underlying Value as the type specified by T
.
C#
public T As<T>(T defaultValue = null)
Parameters
defaultValue
T
The value to provide in the case there the Value is a null reference (Nothing in Visual Basic).
Returns
The Value typed as T
or defaultValue
in case there Value is a null reference (Nothing in Visual Basic) or could not converted to the T
specified.
Retrieves a new OpcValue´1 instance its Value is of the type specified by T
.
C#
public OpcValue<T> AsValue<T>()
Returns
A new instance of the OpcValue´1 class its Value is typed as T
and its further value information has been adopted from this OpcValue or a null reference (Nothing in Visual Basic) if the Value could not converted to the T
specified.
Converts the value of this instance to its equivalent string representation.
C#
public override string ToString()
Returns
The string representation of the value of this instance.
Converts the value of this instance to its equivalent string representation using the specified format and culture-specific format information.
C#
public virtual string ToString(string format, IFormatProvider formatProvider)
Parameters
format
String
A standard or custom format string.
formatProvider
IFormatProvider
An object that supplies culture-specific formatting information.
Returns
The string representation of the value of this instance as specified by format and provider.
Exceptions
The format
is invalid or not supported.
Returns a value indicating whether two instance of OpcValue are equal.
C#
public static bool operator ==(OpcValue left, OpcValue right)
Returns a value indicating whether two instances of OpcValue are not equal.
C#
public static bool operator !=(OpcValue left, OpcValue right)