Chapter 3 Programming
3
– 20
3.6.3 Available characters for variable names
Available characters for variable names are only alphabet a to z, A to Z and number 0 to 9 and _ (underscore). The
first character must not be numeric characters. Several words like BOOL, WORD, IF, FOR etc. are reserved.
Supported characters
Types
Supported
Remarks
Numerical
0 to 9
Not allowed to begin with numeric characters.
Alphabetical
a to z, A to Z
Symbol
_
Trailing underscores are not allowed.
Examples for variable names
Allowed or not
Examples
Descriptions
Allowed
Test_200
TEST
Test55
_Test
Not allowed
2test
Starting with numeric character.
test__200
Trailing underscores are not allowed
test-5
Minus sign is not allowed.
test#3
Other signs than underscore are not allowed.
test 3
Space is not allowed.
IF
Reserved word.
3.6.4 Numeric literals
Numeric literals are specified as follows.
Types
Examples
Applicable for
Integer
-12 0 123_456 +986 10#1234
Underscore is ignored
Real
-12.0 0.0 0.4560 3.14159_26
Underscore is ignored
Real with exponents
-1.34E-12 1.0E+6 1.23E6
Base 2
2#1111_1111 2#1110_0000
Underscore is ignored
Base 8
8#377 8#340
Base 16
16#FF 16#ff 16#1234_ABCD
Underscore is ignored
Boolean zero and one
0 1 FALSE TRUE
FALSE=0, TRUE=1
Time
T#100ms, T#5.5s
Timer (TON, etc.)
Date
DT#2012-12-31-12:34:56
RTC (Realtime clock)
Содержание EH-A14EDR
Страница 6: ...MEMO ...
Страница 10: ...MEMO ...
Страница 141: ...Chapter 3 Programming 3 81 Program ...
Страница 166: ...Chapter 5 Maintenance 5 4 MEMO ...
Страница 170: ...Appendix A1 4 MEMO ...