Specification Of Constants K, H And E (Decimal, Hexadecimal And Real Numbers); Constant "K" (Decimal Number); Constant "H" (Hexadecimal Number); Constant "E" (Real Number) - Mitsubishi Electric MELSEC-Q Structured Programming Manual

Hide thumbs Also See for MELSEC-Q:
Table of Contents

Advertisement

FXCPU Structured Programming Manual
[Device & Common]
3.2
Specification of Constants K, H and E (Decimal, Hexadecimal and Real
Numbers)
When handling constants in a sequence program, use constants "K (decimal)", "H (hexadecimal)" and 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.
3.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 used as operands in instructions (Example: K1234).
The decimal constant specification range is as follows:
- When word data (16 bits) is used •••• K-32768 to K32767
- When double word data (32 bits) is used •••• K-2,147,483,648 to K2,147,483,647
3.2.2

Constant "H" (hexadecimal number)

"H" indicates a hexadecimal number, and is mainly used to specify numeric values used as operands in
instructions (Example: H1234).
When a number in the range from 0 to 9 is used in every digit, BCD data can be specified because the status
of each bit (1 or 0) is equivalent to the BCD code.
(Example: When specifying BCD data for "H1234", specify each digit of the hexadecimal number using 0 to
9.)
The hexadecimal constant specification range is as follows:
- When word data (16 bits) is used•••H0 to HFFFF
- When double word data (32 bits) is used •••H0 to HFFFFFFFF (H0 to H99999999 in the case of BCD data)
3.2.3

Constant "E" (real number)

"E" indicates a real number (floating point data), and is mainly used to specify numeric values used as
operands in instructions (Example: E1.234 or E1.234+3).
The real number setting range is from -1.0 × 2
In sequence programs, a real number can be specified in two methods, "normal expression" and "exponent
expression".
- Normal expression •••••• Specify a numeric value as it is.
- Exponent expression••••Specify a numeric value in the format "(Numeric value) × 10
FX
/FX
/FX
0S
0
0N
In FX
PLCs, this function is support in Ver. 1.10 and later.
3G
128
For example, specify "10.2345" in the format "E10.2345".
For example, specify "1234" in the format "E1.234+3".
"+3" in "E1.234+3" indicates "10
/FX
/FX
/FX
/FX
/FX
1S
1N
1NC
U
3 How to Specify Devices and Constants in Instructions

3.2 Specification of Constants K, H and E (Decimal, Hexadecimal and Real Numbers)

(H0 to H9999 in the case of BCD data)
128
-126
to -1.0 × 2
, 0, 1.0 × 2
3
".
/FX
/FX
PLCs do not support real numbers (E).
2C
2N
2NC
-126
128
to 1.0 × 2
n
".

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-lMelsec-fFx3sFx3gFx3gcFx3u ... Show all

Table of Contents