7 DATA TYPE MAPPING

Mapping rules from data type in CSP+ for machine to the OPC UA DataType are shown in Table 8‑1.

Table 8‑1 – Mapping Rules between Data Type in CSP+ for Machine and OPC UA DataType

No.Data type in CSP+ for machine
(Left: Classification, Right: Data type)
OPC UA DataTypeRemarks
1.Boolean typeBOOLBooleanMap "0" in the CSP+ for machine to "FALSE" for OPC UA and map "1" in the CSP+ for machine to "TRUE" for the OPC UA.
2.Binary typeBIN8Int16

The intention "Display values in bit unit" by the binary type is described by the ValueAsText Attribute.

Example: Set the ValueAsText Attribute to "00111010" in BIN8 or "0000000000111010" in BIN16 for the value 58 (0x3A).

3.BIN16Int16
4.BIN32Int32
5.

BINx

(x = 1 to 15)

Int16
6.Bit string type (Hexadecimal)BYTEUInt16

ValueAsText Attribute is used to describe hexadecimal.

Example: Set the ValueAsText Attribute to "0x3A" in BYTE or "0x003A" in WORD for the value 58 (0x3A).

7.WORDUInt16
8.DWORDUInt32
9.

BIT_STRINGx

(x = 2 to 15)

UInt16
10.

Signed integral data type

(Decimal)

INT8Int16-
11.INT16Int16
12.INT32Int32
13.

INTx

(x = 2 to 15)

Int16
14.

Unsigned integral data type

(Decimal)

UINT8UInt16-
15.UINT16UInt16
16.UINT32UInt32
17.

UINTx

(x = 2 to 15)

UInt16
18.

BCD integral data type

(Decimal)

BCD8UInt16

Numerical value notation in BCD as one decimal per 4 bits is described by the ValueAsText Attribute.

Example: Set the ValueAsText Attribute to "58" in BYTE or "0058" in WORD for the value "58".

19.BCD16UInt16
20.BCD32UInt32
21.

BCDx

(x = 4,12)

UInt16
22.

Real data type

(Decimal)

REALFloat-
23.LREALDouble-
24.String type

STRING(x)

("x" shows an integer from 1 to 2048.)

String-
25.

STRING_U(x)

("x" shows an integer from 1 to 2048.)

String

or

LocalizedText

As the String DataType for OPC UA is in Unicode, mapping from STRING_U (x) data type in the CSP+ for machine is available. When a locale ID (e.g. "en-US") needs to be specified, the mapping should be conducted to the LocalizedText DataType.
26.Time typeTIMEInt32Use EngineeringUnits Property of the variable to specify a unit "ms" and use ValueAsText Attribute to describe a preset notation such as "T#3d11h45m15s123ms".
27.Date typeDATEDateTime-
28.Accuracy typeACCURACYDouble-
29.IP address typeIP_V4StringDescribe the value in a string.
30.IP_V4_64StringDescribe the value in a string.
31.Aggregation type

Data type + "()"

[Example] INT8(),

STRING(10)()

-As this document does not specify any rules to the CSP+ for machine element having this data type, no DataType mapping rules are specified.
32.Array typeData type +
"["Number of elements +"]"
-The OPC UA describes the array by the variable ValueRank Attribute (Number of array dimensions) and ArrayDimensions Attribute (Number of elements for each dimension).