Mitsubishi Electronics FX Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-121
5.11.5 EADD (FNC 120)
Operation:
The floatin
g
point values stored in the source
devices S
1
and S
2
are al
g
ebraicall
y
added and the
result stored in the destination device D.
Points to note:
a) The instruction must use the double word format; i.e.,
D
EADD or
D
EADDP. All source data
and destination data will be double word; i.e. uses two consecutive data re
g
isters to store
the data (32 bits).
Except for K or H, all source data will be re
g
arded as bein
g
in floatin
g
point format and the
result stored in the destination will also be in floatin
g
point format.
b) If a constant K or H is used as source data, the value is converted to floatin
g
point before
the addition operation.
c) The addition is mathematicall
y
correct: i.e., 2.3456
×
10
2
+ (-5.6
×
10
-1
) = 2.34
×
10
2
d) The same device ma
y
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 ever
y
pro
g
ram scan unless the pulse modifier or an interlock pro
g
ram is
used.
e) If the result of the calculation is zero “0” then the zero fla
g
, M8020 is set ON.
If the result of the calculation is lar
g
er than the lar
g
est floatin
g
point number then the carr
y
fla
g
, M8021 is set ON and the result is set to the lar
g
est value.
If the result of the calculation is smaller than the smallest floatin
g
point number then the
borrow fla
g
, 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
(Floatin
g
Point
Addition)
Adds two floatin
g
point numbers
to
g
ether
K, H - inte
g
er value automaticall
y
converted to floatin
g
point
D - must be in floatin
g
point
format (32 bits).
D - a floatin
g
point value
(32 bits).
DEADD,
DEADDP:
13 steps
DEADD
X07
K52000
D106 D108
For more information about the format of floatin
g
point number refer to pa
g
e 4-46.