Mitsubishi MELSEC Q Series Programming Manual page 231

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

D-
(1) Subtracts 32-bit BIN data designated by
stores the result of the subtraction at the device designated by
(2) The values for
(BIN 32 bits).
(3) Judgment of whether the data is positive or negative is made on the basis of the most
significant bit (b31).
• 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 2147483648
(80000000
)
H
K2147483647
(7FFFFFFF
)
H
Operation Error
(1) There are no operation errors associated with the D+(P) or D-(P) instruction.
Program Example
(1) The following program adds 28-bit data from X10 to X2B to the data at D9 and D10 when X0
goes ON, and outputs the result of the operation to Y30 to Y4B.
[Ladder Mode]
(2) The following program subtracts the data from M0 to M23 from the data at D0 and D1 when
XB goes ON, and stores the result at D10 and D11.
[Ladder Mode]
+1
S1
S1
S2
+1
b31
b16 b15
b0
b31
b16 b15
567890 (BIN)
123456 (BIN)
,
and
can be designated at between
S1
S2
D
K2
K2147483646
(00000002
)
(7FFFFFFE
)
H
H
K 2
K 2147483647
(FFFFFFFE
)
(80000001
)
H
H
from 32-bit BIN data designated by
S1
.
D
D
D
S2
+1
b0
b31
b16 b15
444434 (BIN)
2147483648 and 2147483647
Since bit 31 value is "0",
result of operation takes a positive value.
Since bit 31 value is "1",
result of operation takes a negative value.
[List Mode]
Step
Instruction
[List Mode]
Step
Instruction
D+(P),D-(P)
and
S2
b0
Device
Device
6-29
1
2
3
4
4
6
7
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents