Справочник Пользователя для Mitsubishi Electronics FX2NC

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-121
5.11.5
EADD (FNC 120)
Operation:
The floating point values stored in the source
devices S
and S
are algebraically added and the
result stored in the destination device D.
Points to note:
a) The instruction must use the double word format; i.e., DEADD or DEADDP. All source data
and destination data will be double word; i.e. uses two consecutive data registers to store
the data (32 bits).
Except for K or H, all source data will be regarded as being in floating point format and the
result stored in the destination will also be in floating point format.
b) If a constant K or H is used as source data, the value is converted to floating point before
the addition operation.
c) The addition is mathematically correct: i.e., 2.3456 
×
 10 
2
 + (-5.6 
×
 10 
-1
) = 2.34 
×
 10 
2
d) The same device may be used as a source and as the destination. If this is the case then,
on continuous operation of the DEADD instruction, the result of the previous operation will
be used as a new source value and a new result calculated.
This will happen every program scan unless the pulse modifier or an interlock program is
used.
e) If the result of the calculation is zero “0” then the zero flag, M8020 is set ON. 
If the result of the calculation is larger than the largest floating point number then the carry
flag, M8021 is set ON and the result is set to the largest value.
If the result of the calculation is smaller than the smallest floating point number then the
borrow flag, M8022 is set ON and the result is set to the smallest value.
Mnemonic
Function 
Operands
Program steps
S
1
S
2
D
EADD
FNC 120
(Floating
Point
Addition)
Adds two floating
point numbers
together
K, H - integer value automatically
converted to floating point
D - must be in floating point
format (32 bits).
D - a floating
point value
(32 bits).
DEADD,
DEADDP:
13 steps
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
PULSE-P
FX
(2C)
FX
FX
2N(C)
FX
0N
FX
0(s)
16 BIT OPERATION
FX
FX
0N
FX
0(s)
FX
(2C)
FX
2N(C)
32 BIT OPERATION
FLAGS
Zero M8020
Borrow M8021
Carry M8022
DEADD
X07
K52000
D106 D108
For more information about the format of floating point number refer to page 4-46.