8 DATA TYPE MAPPING

Mapping rules from data type in CSP+ for machine to the OPC UA DataType are shown in Table 81.
Table 81 – Mapping Rules between Data Type in CSP+ for Machine and OPC UA DataType
No 
No. | Data type in CSP+ for machine (Left: Classification, Right: Data type) | OPC UA DataType | Remarks | |
---|---|---|---|---|
1. | Boolean type | BOOL | Boolean | Map “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 type | BIN8 | Int16 | 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. | BIN16 | Int16 | ||
4. | BIN32 | Int32 | ||
5. | BINx (x = 1 to 15) |
Int16 | ||
6. | Bit string type (Hexadecimal) | BYTE | UInt16 | 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. | WORD | UInt16 | ||
8. | DWORD | UInt32 | ||
9. | BIT_STRINGx (x = 2 to 15) |
UInt16 | ||
10. | Signed integral data type (Decimal) |
INT8 | Int16 | - |
11. | INT16 | Int16 | ||
12. | INT32 | Int32 | ||
13. | INTx (x = 2 to 15) |
Int16 | ||
14. | Unsigned integral data type (Decimal) |
UINT8 | UInt16 | - |
15. | UINT16 | UInt16 | ||
16. | UINT32 | UInt32 | ||
17. | UINTx (x = 2 to 15) |
UInt16 | ||
18. | BCD integral data type (Decimal) |
BCD8 | UInt16 | 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. | BCD16 | UInt16 | ||
20. | BCD32 | UInt32 | ||
21. | BCDx (x = 4,12) |
UInt16 | ||
22. | Real data type (Decimal) |
REAL | Float | - |
23. | LREAL | Double | - | |
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 type | TIME | Int32 | Use 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 type | DATE | DateTime | - |
28. | Accuracy type | ACCURACY | Double | - |
29. | IP address type | IP_V4 | String | Describe the value in a string. |
30. | IP_V4_64 | String | Describe 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 type | Data 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). |