Mitsubishi MELSEC QS Series Programming Manual page 107

Hide thumbs Also See for MELSEC QS Series:
Table of Contents

Advertisement

(1) Subtracts 16-bit BIN data designated by
stores the result of the subtraction at the device designated by
(2) Values for
S1
(3) The judgment of whether data is positive or negative is made by the most significant bit
(b15).
• 0: Positive
• 1: Negative
(4) The following will happen when an underflow or overflow is generated in an operation result:
The carry flag in this case does not go ON.
. K 32768
(H8000)
. K32767
(H7FFF)
Operation Error
(1) There are no operation errors associated with the +(P) or –(P) instructions.
Program Example
(1) The following program adds, when X5 is turned ON, the data at D3 and D0 and outputs the
operation result at Y38 to Y3F.
[Ladder Mode]
(2) The following program outputs the difference between the set value for timer T3 and its
present value in BCD to Y40 to Y53.
[Ladder Mode]
S1
b15
b0
b15
5678 (BIN)
1234 (BIN)
,
and
can be designated between
S2
D
K 2
K32766
Since b15 is "0", the judgment is
a positive value.
(H0002)
(H7FFE)
K
2
K
32767
Since b15 is "1", the judgment is
(HFFFE)
(H8001)
a negative value.
6.2.1 BIN 16-bit addition and subtraction operations (+(P), –(P))
from 16-bit BIN data designated by
S1
.
D
D
S2
b0
b15
4444 (BIN)
32768 and 32767 (BIN, 16 bits).
6.2 Arithmetic Operation Instructions
+(P), -(P)
and
S2
b0
6-9
6

Advertisement

Table of Contents
loading

Table of Contents