153
FX3G/
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
5 How to Specify Devices and Constants to Instructions
5.2 Specification of Constants K, H and E (Decimal, Hexadecimal and Real Number)
1
Introduction
2
Overview
3
Instruction
List
4
Devices
in Detail
5
Specified the
Device &
Constant
6
Before
Programming
7
Basic
Instruction
8
FNC00-FNC09
Program Flow
9
FNC10-FNC19
Move & Compare
10
FNC20-FNC29
Arith. & Logic
Operation
5.2 Specification of Constants K, H and E
(Decimal, Hexadecimal and Real Number)
When handling constants in a sequence program, use constant K (decimal), H (hexadecimal) or E (floating point).
In peripheral equipment for programming, add "K" to a decimal number, "H" to a hexadecimal number and "E" to a
floating point (real number) for operations associated with numeric values in instructions. (Examples: K100 (decimal
number), H64 (hexadecimal number) and E1.23 (or E1.23 + 10) (real number))
The roles and functions of constants are described below.
5.2.1 Constant K (decimal number)
"K" indicates a decimal integer, and is mainly used to specify the set value of timers and counters and numeric values
as operands in applied instructions. (Example: K1234)
The decimal constant specification range is as follows:
- When word data (16 bits) is used ... K-32768 to K32767
- When double data (32 bits) is used ... K-2,147,483,648 to K2,147,483,647
5.2.2 Constant H (hexadecimal number)
"H" indicates a hexadecimal number, and is mainly used to specify numeric values as operands in applied instructions.
(Example: H1234)
When using digits 0 to 9, the bit status (1 or 0) of each bit is equivalent to the BCD code, so BCD data can be specified
also.
(Example: H1234 ... When specifying BCD data, specify each digit of hexadecimal number in 0 to 9.)
The hexadecimal constant setting range is as follows:
- When word data (16 bits) is used ... H0 to HFFFF (H0 to H9999 in the case of BCD data)
- When double data (32 bits) is used ... H0 to HFFFFFFFF (H0 to H99999999 in the case of BCD data)
5.2.3 Constant E (real number)
"E" indicates a real number (floating point data), and is mainly used to specify numeric values as operands in applied
instructions. (Example: E1.234 or E1.234 + 3)
The real number setting range is from −1.0 × 2
128
to −1.0 × 2
−126
, 0 and 1.0 × 2
−126
to 1.0 × 2
128
.
In a sequence program, a real number can be specified in two methods, "normal expression" and "exponent
expression".
- Normal expression: .................. Specify a numeric value as it is.
For example, specify "10.2345" in the form "E10.2345".
- Exponent expression: .............. Specify a numeric value in the format "(numeric value) × 10
n
".
For example, specify "1234" in the form "E1.234 + 3".
"+3" in "E1.234 + 3" indicates "10
3
".