Table 4 - Numeric literals
No.
Feature description
Examples
1
Integer literals
-12 0 123_456 +986
2
Real literals
-12.0 0.0 0.4560 3.14159_26
3
Real literals with exponents
-1.34E-12 or -1.34e-12
1.0E+6 or 1.0e+6
1.234E6 or 1.234e6
4
Base 2 literals
2#1111_1111 (255 decimal)
2#1110_0000 (224 decimal)
5
Base 8 literals
8#377 (255 decimal)
8#340 (224 decimal)
6
Base 16 literals
16#FF or 16#ff (255 decimal)
16#E0 or 16#e0 (224 decimal)
7
Boolean zero and one
0 1
8
Boolean FALSE and TRUE
FALSE TRUE
9
Typed literals
DINT#5 (DINT representation of 5)
UINT#16#9AF (UINT representation of the hexadecimal value 9AF )
BOOL#0 BOOL#1 BOOL#TRUE BOOL#FALSE
NOTE The keywords FALSE and TRUE correspond to Boolean values of 0 and 1, respectively.
2.2.2 Character string literals
Character string literals include single-byte or double-byte encoded characters.
A single-byte character string literal is a sequence of zero or more characters from Row 00 of the
ISO/IEC 10646-1 character set prefixed and terminated by the single quote character ('). In single-
byte character strings, the three-character combination of the dollar sign ($) followed by two
hexadecimal digits shall be interpreted as the hexadecimal representation of the eight-bit character
code, as shown in feature 1 of table 5.
A double-byte character string literal is a sequence of zero or more characters from the ISO/IEC
10646-1 character set prefixed and terminated by the double quote character ("). In double-byte
character strings, the five-character combination of the dollar sign ($) followed by four hexadecimal
digits shall be interpreted as the hexadecimal representation of the sixteen-bit character code, as
shown in feature 2 of table 5.
Two-character combinations beginning with the dollar sign shall be interpreted as shown in table 6
when they occur in character strings.
Copyright International Electrotechnical Commission
Provided by IHS under license with IEC
Not for Resale
No reproduction or networking permitted without license from IHS
--``````-`-`,,`,,`,`,,`---
61131-3
IEC:2003(E)
– 27 –
Do'stlaringiz bilan baham: |