Mitsubishi MELSEC-Q/L Programming Manual page 191

Table of Contents

Advertisement

(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
K2
(8000
)
(0002
)
H
H
K 2
K32767
(7FFF
)
(FFFE
)
H
H
Operation Error
(1) There is no operation error in the +(P) or -(P) instruction.
When three data are set (
+,
+P, P
: Data to be added to/subtracted from or head number of the devices where the data to be added to/subtracted from is stored (BIN 16 bits)
S1
: Data for additing/subtracting or head number of the devices where the data for additing/subtracting is stored (BIN 16 bits)
S2
: Head number of the devices where the addition/subtraction operation result will be stored (BIN 16 bits)
D
Internal Devices
Setting
Data
Bit
Word
S1
S2
D
Function
+
(1) Adds 16-bit BIN data designated by
device designated by
D
(2) Values for
,
and
S1 S2
D
(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.
K32767 +K2
K 32767
(7FFF
)
(0002
)
H
H
K 32768 +K 2
(8000
)
(FFFE
)
H
H
Since bit 15 value is "0",
K32766
(7FFE
)
result of operation takes a positive value.
H
Since bit 15 value is "1",
K 32767
(8001
)
result of operation takes a negative value.
H
+
,
-
)
S1
S2
D
S1
S2
D
Command
Command
J
R, ZR
Bit
to 16-bit BIN data designated by
S1
.
S1
b15
b0
b15
5678 (BIN)
can be designated between
Since bit 15 value is "1",
(8001
)
result of operation takes a negative value.
H
K32766
Since bit 15 value is "0",
(7FFE
)
H
result of operation takes a positive value.
indicates an instruction symbol of
S1
S2
P
S1
S2
\
U
\G
Word
and stores the result of the addition at the
S2
D
S2
b0
b15
1234 (BIN)
6912 (BIN)
-32768 and 32767 (BIN, 16 bits).
D
+, +P, -, -P
+/
.
D
D
Constants
Zn
Other
K, H
––
––
––
––
b0
1
2
3
4
6
7
8
189

Advertisement

Table of Contents
loading

Table of Contents