Constants (Literals) and Data Type Syntax
Type | Format | Examples |
---|---|---|
(1) Boolean literals |
The following 4 literals are available:
|
n/a |
(2) Integer literals |
Decimal: <Literal> Binary: 2#<Literal> Octal: 8#<Literal> Hexadecimal: 16#<Literal> |
Decimal: 1234 Binary: 2#101010 Octal: 8#12 Hexadecimal: 16#1AF5 |
(3) Real literals | n/a |
|
(4) Typed literals | <Data type>#<Literal> |
The following 15 data types are available.
|
(5) String literals |
‘<String>’ The XEM CPU modules support up to 32 characters in a STRING data. The following $ codes are available:
|
‘ABC’ ‘That$’s it!’ |
(6) Duration literals |
TIME#<d>d<h>h<m>m<s>s<ms>ms T#<d>d<h>h<m>m<s>s<ms>ms
Note: The XEM CPU modules don’t support ‘us’ and ‘ns’. |
TIME#1d2h3m4s5ms T#1d2h3m4s5ms |
(7) Date literals |
|
DATE#2023-01-01 D#2023-01-01 |
(8) Time-of-Day literals |
|
TIME_OF_DAY#12:34:45 TOD#12:34:45 |
(9) Date-and-Time literals |
|
DATE_AND_TIME#2023-01-01-12:34:45 DT#2023-01-01-12:34:45 |
Array |
The XEM CPU modules support up to 3 dimensional array.
Note: The index of array starts from 0 with the XEM CPU modules. |
iA[2] wB[iD, 4] rC[iE, 6, 7] |
LP307-7