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

Скачать
Страница из 382
FX Series Programmable Controlers
Applied Instructions 5
5-26
Operation 2: (Applicable units: FX
(2C)
)
This function is equivalent to FNC 120 EADD.
When ‘floating point mode flag’ M8023 is active, i.e.
ON, DADD and DADDP instructions can be used to
perform floating point additions.
When M8023 is reset, i.e. OFF floating point
manipulation will not occur. Constants (K/H) and
floating point numbers (stored in double data
registers D) can be added in any configuration. The
constants (K/H) will automatically be converted to the ‘floating point format’ for the addition
operation. Answers for an operation can only be stored in double (32 bit) data registers. Items a)
and b) above are also valid for this operating mode.
FX2N Support for floating point operations
5.3.2
SUB (FNC 21) 
Operation 1: (Applicable to all units)
The data contained within the source device, S
is
subtracted from the contents of source device S
1
.
The result or remainder of this calculation is stored
in the destination device D. Note: the ‘Points to note’, under the ADD instruction (previous
page) can also be similarly applied to the subtract instruction.
Operation 2: (Applicable units: FX
(2C)
) This function is equivalent to FNC 121 ESUB. The
information regarding ‘Operation2:’ of the ADD instruction apply similarly to this second
operation of the SUB instruction (with the exception of a subtraction being performed instead
of an addition). Again, only constants and double data words can be manipulated with only
DSUB, DSUBP instruction formats being valid.
Mnemonic
Function 
Operands
Program steps
S
1
S
2
D
SUB
FNC 21
(Subtract)
One source 
device
is subtracted from
the other - the
result is stored in
the destination
device
K, H, KnX, KnY, KnM, KnS,
T, C, D, V, Z
KnY, KnM, KnS,
T, C, D, V, Z 
SUB, SUBP:
7steps
DSUB,
DSUBP:
13 steps
When using M8023 to subtract floating point 
data, only double word (32 bit) data registers 
(D) or constants (K/H) may be used. See page 
4-46 for more details regarding floating point 
format.
FX
0(S)
FX
0N
FX FX
(2C)
FX
2N(C)
X10
M8023
M8000
M8023
H3F
D 4
[ S1 ]
[ D ]
D 4
[ S2 ]
DADDP
Note: The use of M8023 is not supported in FX
2N 
units.
The appropriate dedicated floating point instruction should be used instead E.g. Instead of
DADD with M8023 ON, use FNC 120, DEADD.
-
See section 5.11
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
X0
SUB
D 10 D 12
[ S1 ]
[ D ]
D 14
[ S2 ]