Elementary Data Types according to IEC 61131-3
|
Note
If you are using iCube Engineer in another user interface language and/or with another Windows system locale than English you must enter numeric values with a '.' as decimal separator (always according to the English standard). This applies, for example, when entering initial values in variables tables or REAL/LREAL literals in the code. |
|
Note
Processing of REAL and LREAL data types There is a limited accuracy when processing REAL and LREAL data types. This is caused by the characteristics of the processor architecture and the data type definition according to IEEE. This applies to the positive and also the negative value range. |
|
Note
Processing of LTOD data type In the event of an overflow (min or max value for the LTOD data type exceeded), the LTOD value is interpreted and displayed as time value in nanoseconds ("xxxxx ns"). |
Data types STRING and WSTRING
The data types STRING (single byte string) and WSTRING (double byte string) are also elementary data types but do not belong to the above mentioned group. The data types STRING and WSTRING have the following structure:
| Byte | Description |
|---|---|
| STRING data type | |
| 0...1 | Capacity - Maximum number of characters that the string can hold (from 0 to UINT16.MAX). |
| 2...3 | Length - Current number of characters in the string (from 0 to Capacity). |
| 4...84 (for an 80 characters string)4...124 (for a user-defined string of 120 characters) |
String of ANSI characters followed by a trailing zero character. Each character is represented by one byte. |
| WSTRING data type | |
| 0-1 | Capacity - Maximum number of characters that the string can hold (from 0 to UINT16.MAX). |
| 2-3 | Length - Current number of characters in the string (from 0 to Capacity). |
| 4...165 (for an 80 characters string)4...245 (for a user-defined string of 120 characters) |
String of UTF16 characters followed by a trailling zero character. Each character is represented by two bytes or, for some language characters, by four bytes. |