In DA server, Automation Data is represented by Value, Quality and Time Stamp for a Tag.

The COM UA Wrapper maps the VQT data to the Data Value and Diagnostic Info structures.

The Error codes returned by the DA server are based on the HRESULT type. The COM UA Wrapper maps this error code to an OPC UA Status Code. Figure A.6illustrates this mapping.

image009.png

Figure A.6– OPC COM DA to OPC UA data & error mapping

The data values in the DA server are represented as Variant Data type. The COM UA Wrapper converts them to the corresponding OPC UA data type. The mapping is shown in Table A.32:

Table A.32– DataTypes and mapping

Variant Data

Type (In DA server)

OPC UA

Data type Mapping in COM UA Server (DataValue structure)

VT_I2

Int16

VT_I4

Int32

VT_R4

Float

VT_R8

Double

VT_BSTR

String

VT_BOOL

Boolean

VT_UI1

Byte

VT_I1

SByte

VT_UI2

UInt16

VT_UI4

UInt32

VT_I8

Int64

VT_UI8

UInt64

VT_DATE

Double

VT_DECIMAL

Decimal

VT_ARRAY

Array of OPC UA types

.

The Quality of a Data Value in the DA server is represented as a 16 bit value where the lower 8 bits is of the form QQSSSSLL (Q: Main Quality, S: Sub Status, L: Limit) and higher 8 bits is vendor specific.

The COM UA Wrapper maps the DA server to the OPC UA Status code as shown Figure A.7:

image010.png

Figure A.7- Status Code mapping

The primary quality is mapped to the Severity field of the Status code. The Sub Status is mapped to the SubCode and the Limit is mapped to the Limit Bits of the Status Code.

Please note that the Vendor quality is currently discarded.

Table A.33shows a mapping of the OPC COM DA primary quality mapping to OPC UA status code

Table A.33– Quality mapping

OPC DA Primary Quality (Quality & Sub status QQSSSS)

OPC UA Status Code

GOOD

Good

LOCAL_OVERRIDE

Good_LocalOverride

UNCERTAIN

Uncertain

SUB_NORMAL

Uncertain_SubNormal

SENSOR_CAL

Uncertain_SensorNotAccurate

EGU_EXCEEDED

Uncertain_EngineeringUnitsExceeded

LAST_USABLE

Uncertain_LastUsableValue

BAD

Bad

CONFIG_ERROR

Bad_ConfigurationError

NOT_CONNECTED

Bad_NotConnected

COMM_FAILURE

Bad_NoCommunication

DEVICE_FAILURE

Bad_DeviceFailure

SENSOR_FAILURE

Bad_SensorFailure

LAST_KNOWN

Bad_OutOfService

OUT_OF_SERVICE

Bad_OutOfService

WAITING_FOR_INITIAL_DATA

Bad_WaitingForInitialData

The Timestamp provided for a value in the DA server is assigned to the SourceTimeStamp of the DataValue in the COM UA Wrapper.

The ServerTimeStamp in the DataValue is set to the current time by the COM UA Wrapper at the start of the Read Operation.