![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/3/8d/38d56254-54fe-46e3-85ae-d3f5260e1091/38d56254-54fe-46e3-85ae-d3f5260e1091-bg98.png)
FX Series Programmable Controlers Applied Instructions 5
5-26
Operation 2:
(Applicable units: FX
(2C)
)
This function is equivalent to FNC 120 EADD.
When ‘floatin
point mode fla
’ M8023 is active, i.e.
ON, DADD and DADDP instructions can be used to
perform floatin
point additions.
When M8023 is reset, i.e. OFF floatin
point
manipulation will not occur. Constants (K/H) and
floatin
point numbers (stored in double data
re
isters D) can be added in an
confi
uration. The
constants (K/H) will automaticall
be converted to the ‘floatin
point format’ for the addition
operation. Answers for an operation can onl
be stored in double (32 bit) data re
isters. Items a)
and b) above are also valid for this operatin
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
2
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
pa
e) can also be similarl
applied to the subtract instruction.
Operation 2:
(Applicable units: FX
(2C)
) This function is equivalent to FNC 121 ESUB. The
information re
ardin
‘Operation2:’ of the ADD instruction appl
similarl
to this second
operation of the SUB instruction (with the exception of a subtraction bein
performed instead
of an addition). A
ain, onl
constants and double data words can be manipulated with onl
DSUB, DSUBP instruction formats bein
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 usin
M8023 to subtract floatin
point
data, onl
double word (32 bit) data re
isters
(D) or constants (K/H) ma
be used. See pa
e
4-46 for more details re
ardin
floatin
point
format.
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 floatin
point instruction should be used instead E.
. Instead of
DADD with M8023 ON, use FNC 120, DEADD.
- See section 5.11
X0
SUB D 10 D 12
[ S1 ] [ D ]
D 14
[ S2 ]