Mitsubishi Electronics FX3G User Manual

Page of 964
157
FX
3S
/FX
3G
/FX
3GC
/FX
3U
/FX
3UC
 Series
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
Introdu
ction
2
Ov
ervi
ew
3
Instruction 
Li
st
4
D
evices 
in Det
ai
l
5
Specifi
ed the
De
vice
 &
 
C
onst
ant
6
Bef
ore
 
Pr
og
ra
mmi
ng
7
Bas
ic 
Instruction
8
FN
C00-FN
C0
9
Program Fl
ow
9
FNC
10-FN
C19
Mov
e & Com
pare
10
FNC
20-FNC
29
Arith. & Lo
gi
Operati
on
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
".