Справочник Пользователя для Mitsubishi Electronics Mitsubishi Digital Electronics Video Gaming Accessories FX3G

Скачать
Страница из 936
153
FX
3G
/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
In
trodu
ct
ion
2
O
ver
vi
ew
3
In
st
ru
ct
ion 
Li
st
4
D
evices 
in D
etail
5
Specifi
ed t
he
D
evice &
 
C
onst
ant
6
Bef
ore 
Pr
ogr
am
m
ing
7
B
asic 
In
st
ru
ct
ion
8
FNC0
0-F
NC0
9
Pr
ogr
am
 Flow
9
FN
C
10-FN
C
19
Mo
ve
 &
 Co
mp
are
10
FNC2
0-F
NC2
9
Ar
ith.
 &
 Logic 
O
per
ati
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
".