Notation Of Constants - Mitsubishi Electric MELSEC iQ-R Series User Manual

Process cpu module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

32.5

Notation of Constants

This section describes the notation of constants.
Type
Boolean value
Integral
Binary
Octal
Decimal
Hexadecimal
Real
Decimal
number
notation
Exponential
notation
String
String
String
[Unicode]
Time
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.
32 CONSTANTS
528
32.5 Notation of Constants
Notation
Set "FALSE" or "TRUE".
Add "K" or "H" before "0" or "1".
Add "2#" before a binary number.
Add "8#" before an octal number.
Directly enter a signed or unsigned decimal number.
Add "K" before a signed or unsigned decimal number.
Add "16#" before a hexadecimal number.
Add "H" before a hexadecimal number.
Directly enter a signed or unsigned real decimal
number with a decimal point.
Add "E" before a signed or unsigned real decimal
number with a decimal point.
Add "E" and a signed or unsigned exponent (decimal)
at the end of the real number.
Add a signed exponent (decimal) at the end of the real
number with "E".
Enclose a string in single quotation marks (' ').
Enclose a string in double quotation marks (" ").
Add "T#" or "TIME#" at the beginning. ( Page 529
Notation of time)
Example
Applicable data type
TRUE, FALSE
Bit
K0, K1, H0, H1
2#0010, 2#01101010,
• Word [unsigned]/bit string [16 bits]
2#1111_1111
• Double word [unsigned]/bit string [32
bits]
8#0, 8#337, 8#1_1
• Word [signed]
123, +123, -123, 12_3
• Double word [signed]
K123, K-123
16#FF, 16#1_1
HFF, HEAD
2.34, +2.34, -2.34,
• Single-precision real number
3.14_15
• Double-precision real number
E2.34, E-2.34
1.0E6, 1.0E-6
E1.001+5, E1.001-6
'ABC'
String
"ABC"
String [Unicode]
T#1h,
Time
T#1d2h3m4s5ms,
TIME#1h

Advertisement

Table of Contents
loading

Table of Contents