Mitsubishi Electronics FX2C Home Theater Server User Manual


 
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
g
point mode fla
g
’ M8023 is active, i.e.
ON, DADD and DADDP instructions can be used to
perform floatin
g
point additions.
When M8023 is reset, i.e. OFF floatin
g
point
manipulation will not occur. Constants (K/H) and
floatin
g
point numbers (stored in double data
re
g
isters D) can be added in an
y
confi
g
uration. The
constants (K/H) will automaticall
y
be converted to the ‘floatin
g
point format’ for the addition
operation. Answers for an operation can onl
y
be stored in double (32 bit) data re
g
isters. Items a)
and b) above are also valid for this operatin
g
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
g
e) can also be similarl
y
applied to the subtract instruction.
Operation 2:
(Applicable units: FX
(2C)
) This function is equivalent to FNC 121 ESUB. The
information re
g
ardin
g
‘Operation2:’ of the ADD instruction appl
y
similarl
y
to this second
operation of the SUB instruction (with the exception of a subtraction bein
g
performed instead
of an addition). A
g
ain, onl
y
constants and double data words can be manipulated with onl
y
DSUB, DSUBP instruction formats bein
g
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
g
M8023 to subtract floatin
g
point
data, onl
y
double word (32 bit) data re
g
isters
(D) or constants (K/H) ma
y
be used. See pa
g
e
4-46 for more details re
g
ardin
g
floatin
g
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
g
point instruction should be used instead E.
g
. 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 ]