25 CONSTANTS
25.5 Notation of Constants
403
25
25.5
Notation of Constants
This section describes the notation of constants.
In the notation of binary, octal, decimal, hexadecimal, and real numbers, the numbers can be separated using
an underscore (_) to make programs easy to see. For example, the double word [unsigned] in the notation of
binary is as follows.
2#1100_1100_1100_1100
The separations by underscores (_) are ignored in program processing.
Type
Notation
Example
Applicable data type
Boolean value
Set "FALSE" or "TRUE".
TRUE, FALSE
Bit
Add "K" or "H" before "0" or "1".
K0, K1, H0, H1
Integral
Binary
Add "2#" before a binary number.
2#0010, 2#01101010,
2#1111_1111
• Word [unsigned]/bit string [16 bits]
• Double word [unsigned]/bit string [32
bits]
• Word [signed]
• Double word [signed]
Octal
Add "8#" before an octal number.
8#0, 8#337, 8#1_1
Decimal
Directly enter a signed or unsigned decimal number.
123, +123, -123, 12_3
Add "K" before a signed or unsigned decimal
number.
K123, K-123
Hexadecimal
Add "16#" before a hexadecimal number.
16#FF, 16#1_1
Add "H" before a hexadecimal number.
HFF, HEAD
Real number
Decimal
notation
Directly enter a signed or unsigned real decimal
number with a decimal point.
2.34, +2.34, -2.34,
3.14_15
• Single-precision real number
• Double-precision real number
Add "E" before a signed or unsigned real decimal
number with a decimal point.
E2.34, E-2.34
Exponential
notation
Add "E" and a signed or unsigned exponent
(decimal) at the end of the real number.
1.0E6, 1.0E-6
Add a signed exponent (decimal) at the end of the
real number with "E".
E1.001+5, E1.001-6
String
String
Enclose a string in single quotation marks (' ').
'ABC'
String
String
[Unicode]
Enclose a string in double quotation marks (" ").
"ABC"
String [Unicode]
Time
Add "T#" or "TIME#" at the beginning. (
T#1h,
T#1d2h3m4s5ms,
TIME#1h
Time
Содержание MELSEC iQ-R-R00CPU
Страница 2: ......
Страница 151: ...9 MONITOR FUNCTION 9 1 Real Time Monitor Function 149 9 MEMO ...
Страница 323: ...18 SEQUENCE SCAN SYNCHRONIZATION SAMPLING FUNCTION 321 18 MEMO ...
Страница 330: ...328 20 ROUTING SETTING 20 3 Precautions MEMO ...
Страница 423: ...26 BASIC CONCEPT 26 8 State Transition of the Redundant System 421 26 MEMO ...
Страница 524: ...522 30 MAINTENANCE AND INSPECTION FOR A REDUNDANT SYSTEM 30 1 Module Replacement in the Redundant System MEMO ...
Страница 1009: ...APPX Appendix 14 List of Available SQL Commands for CPU Module Database Access Function 1007 A MEMO ...
Страница 1014: ...1012 APPX Appendix 15 Added and Enhanced Functions MEMO ...
Страница 1027: ......