Errata exists for this version of the document.
In an OPC UA Server, Automation Data is represented as a Data Value and and status, in addition additional error data can be provided via Diagnostic Info for a tag
The COM UA Proxy maps the Data Value structure into VQT data and error code.
For successful operations(StatusCode of Good and Uncertain), the COM UA Proxy maps the Status Code of the DataValue to the OPC DA Quality But in case of error(StatusCode of Bad), the Status Code is mapped to the OPC DA Error code.
The StatusCode in the Diagnostic Info returned by the OPC UA Server are mapped to OPC DA Error codes. Figure A.9 illustrates this mapping.
Figure A.9 – OPC UA to OPC DA data & error mapping
The COM UA Proxy converts the OPC UA Data Value to the corresponding OPC DA Variant type. The mapping is shown in Table A.36. For DataTypes that are subtypes of an existing base DataType the conversion for the Base DataType is used.
Table A.36 – DataTypes and Mapping
OPC UA Data type (Bin UA Server) |
Variant Data Type (In DA server) |
Int16 |
VT_I2 |
Int32 |
VT_I4 |
Float |
VT_R4 |
Double |
VT_R8 |
Decimal |
VT_DECIMAL |
String |
VT_BSTR |
Boolean |
VT_BOOL |
Byte |
VT_UI1 |
SByte |
VT_I1 |
UInt16 |
VT_UI2 |
UInt32 |
VT_UI4 |
Int64 |
VT_I8 |
UInt64 |
VT_UI8 |
Guid |
VT_BSTR |
DateTime |
VT_DATE |
NodeId |
VT_BSTR |
XmlElement |
VT_BSTR |
ExpandedNodeId |
VT_BSTR |
QualifiedName |
VT_BSTR |
LocalizedText |
VT_BSTR |
StatusCode |
VT_UI4 |
ExtensionObject |
Array of VT_UI1 |
Array of above OPC UA types |
Array of corresponding Variant type |
The Quality of a Data Value in the OPC UA Server is represented as a StatusCode.
The COM UA Proxy maps the Severity, Subcode and the limit bits of the OPC UA Status code to the lower 8 bits of the OPC DA Quality structure (of the form QQSSSSLL).
Figure A.10 – OPC UA Status Code to OPC DA quality mapping
The Severity field of the Status code is mapped to the primary quality. The SubCode is mapped to the Sub Status and the Limit Bits are mapped to the Limit field.
Table A.37 shows a mapping of the OPC UA status code to OPC DA primary quality
OPC UA Status Code |
OPC DA Primary Quality (Quality & Sub status QQSSSS) |
Good |
GOOD |
Good_LocalOverride |
LOCAL_OVERRIDE |
Uncertain |
UNCERTAIN |
Uncertain_SubNormal |
SUB_NORMAL |
Uncertain_SensorNotAccurate |
SENSOR_CAL |
Uncertain_EngineeringUnitsExceeded |
EGU_EXCEEDED |
Uncertain_LastUsableValue |
LAST_USABLE |
Bad |
BAD |
Bad_ConfigurationError |
CONFIG_ERROR |
Bad_NotConnected |
NOT_CONNECTED |
Bad_NoCommunication |
COMM_FAILURE |
Bad_OutOfService |
OUT_OF_SERVICE |
Bad_DeviceFailure |
DEVICE_FAILURE |
Bad_SensorFailure |
SENSOR_FAILURE |
Bad_WaitingForInitialData |
WAITING_FOR_INITIAL_DATA |
If available, the SourceTimestamp of the DataValue in the OPC UA Server is assigned to the Timestamp for the value in the COM UA Proxy. If SourceTimestamp is not available, then the ServerTimestamp is used.