QuickOPC User's Guide and Reference
UADataMappingKind Enumeration



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.LiveMapping Namespace : UADataMappingKind Enumeration
Specifies how the OPC Unified Architecture (OPC-UA) data will be mapped.
Syntax
'Declaration
 
<ComVisibleAttribute(False)>
<DisplayName2Attribute("OPC-UA Data Mapping Kind")>
Public Enum UADataMappingKind 
   Inherits System.Enum
   Implements System.IComparable, System.IConvertible, System.IFormattable 
'Usage
 
Dim instance As UADataMappingKind
[ComVisible(false)]
[DisplayName2("OPC-UA Data Mapping Kind")]
public enum UADataMappingKind : System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
[ComVisible(false)]
[DisplayName2("OPC-UA Data Mapping Kind")]
public enum class UADataMappingKind : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable  
Members
MemberValueDescription
AttributeData5Map the data value/timestamps/status code combination, as OpcLabs.EasyOpc.UA.UAAttributeData or a generic UAAttributeData.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

ErrorId1Map the error ID, as System.String.
ErrorMessage3Map the error message, as System.String. An empty string if the operation has been successful.
Exception2Map the exception, as Exception or a derived type. null if the operation has been successful.
Result0Map the operation result, as OpcLabs.BaseLib.OperationModel.OperationResult or a derived type specific for the operation.
ServerTimestamp7Map the server timestamp, as System.DateTime. In UTC.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

When writing, be aware that writing the server timestamp is not supported by some servers, including the OPC Foundation sample server.

ServerTimestampLocal8Map the server timestamp, as System.DateTime. In local time.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

When writing, be aware that writing the server timestamp is not supported by some servers, including the OPC Foundation sample server.

SourceTimestamp9Map the source timestamp, as System.DateTime. In UTC.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

SourceTimestampLocal10Map the source timestamp, as System.DateTime. In local time.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

StatusCode11Map the status code, as OpcLabs.EasyOpc.UA.UAStatusCode.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

StatusInfo4Map the status information, as StatusInfo.
Value6Map the attribute value, as System.Object or a specific type. This is the default mapping kind.

Remarks:

The linking target value is not changed if the operation resulted in an exception.

Remarks

 

When you describe that certain mapping target (e.g. a property) should be mapped to certain mapping source (e.g. an OPC item), there is still a piece of information missing: What exactly is the content of that mapping target? For example, with OPC-DA item, does the mapped element contain the value of the OPC item itself, or the quality, or does it contain the value/timestamp/quality combination, or even something else?

In order to distinguish between these, the live mapping has a concept of a mapping kind. You can choose which kind of mapping to use for certain mapping target. You can also map the same source to multiple targets, each time with a different mapping kind. Using this approach, you can e.g. map the value, timestamp, and quality, each to a separate property.

The mapping kind is specified using the Kind property of the DAItem attribute (for OPC-DA item mappings) on the target member or on the UAData attribute (OPC OPC-UA data mappings).

The following table lists all possible mapping for OPC-DA item mappings. When no mapping kind is specified, the default mapping kind of Value is used.

Kind Type Description
Result OperationResult or a derived type Map the operation result.
ErrorId Int32 Map the error ID. Always empty with success.
Exception Exception or a derived type Map the exception. null if the operation has been successful.
ErrorMessage String Map the error message. An empty string if the operation has been successful.
StatusInfo StatusInfo Map the status information.
Vtq DAVtq or DAVtq<T> Map the item value/timestamp/quality combination. See Note 1.
Value Object or T Map the item value. This is the default mapping kind. See Note 1.
Timestamp DateTime Map the timestamp. In UTC. See Note 1.
TimestampLocal DateTime Map the timestamp. In local time. See Note 1.
Quality DAQuality Map the OPC quality. See Note 1.

For OPC-DA property mappings, the mapping kind is specified using the Kind property of the DAProperty attribute on the target member. The following table lists all possible mapping for OPC-DA property mappings. When no mapping kind is specified, the default mapping kind of Value is used.

Kind Type Description
Result OperationResult or a derived type Map the operation result.
ErrorId Int32 Map the error ID. Always empty with success.
Exception Exception or a derived type Map the exception. null if the operation has been successful.
ErrorMessage String Map the error message. An empty string if the operation has been successful.
StatusInfo StatusInfo Map the status information.
Value Object or T Map the property value. This is the default mapping kind. See Note 1.

The following table lists all possible mapping for OPC-UA data mappings. When no mapping kind is specified, the default mapping kind of Value is used.

Kind Type Description
Result OperationResult or a derived type Map the operation result.
ErrorId Int32 Map the error ID. Always empty with success.
Exception Exception or a derived type Map the exception. null if the operation has been successful.
ErrorMessage String Map the error message. An empty string if the operation has been successful.
StatusInfo StatusInfo Map the status information.
AttributeData UAAttributeData or UAAttributeData <T> Map the attribute value/source timestamp/server timestamp/status code combination. See Note 1.
Value Object or T Map the item value. This is the default mapping kind. See Note 1.
ServerTimestamp DateTime Map the server timestamp. In UTC. See Note 1.
ServerTimestampLocal DateTime Map the server timestamp. In local time. See Note 1.
SourceTimestamp DateTime Map the source timestamp. In UTC. See Note 1.
SourceTimestampLocal DateTime Map the source timestamp. In local time. See Note 1.
StatusCode UAStatusCode Map the status code. See Note 1.

Note 1: The mapping target value is not changed if the operation resulted in an exception. This means that when an error occurs, the mapping target with this mapping kind will not be reset to null or other default value; in fact it won’t be influenced at all.  E.g. if an item’s value (a property annotated with mapping kind of Value) is successfully obtained once, and then an error occurs in a subsequent operation, the target property will remain unchanged. You can detect the error by additional mappings with different mapping kinds (e.g. Exception).

 

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         OpcLabs.EasyOpc.UA.LiveMapping.UADataMappingKind

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also