Bin 16-Bit Addition And Subtraction Operations - Mitsubishi Electric MELSEC Q Series Programming Manual

Motion controller
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

5 SEQUENCE INSTRUCTIONS FOR MOTION CPU

5.4.3 BIN 16-bit addition and subtraction operations: +, -

Setting
data
(Note-1)
X
Y
M
(S1)
(S2)
(D)
[Setting data]
[Function]
Bit device
SM
F
T
C
D
[Instruction]
Command
+
Command
-
Setting data
Number of the devices where the data to be added to/subtracted from is
(S1)
Data for adding/subtracting or number of the devices where the data for
(S2)
Number of the devices where the addition/subtraction operation result will
(D)
(1) BIN 16-bit addition operation (+)
• Adds 16-bit BIN data designated by (S1) to 16-bit BIN data designated by (S2)
and stores the result of the addition at the device designated by (D).
• Values for (S1), (S2) (D) and can be designated between (D) -32768 and 32767
(BIN, 16 bits).
• The judgment of whether data is positive or negative is made by the most
significant bit (b15).
0: Positive
1: Negative
• 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
(7FFFH)
(0002H)
K-32768
+ K-2
(8000H)
(FFFEH)
Usable device
Word device
W
T
C
SD
Z
(Note-1): Cannot specify the same device in (S1) and (D), or (S2) and (D).
+
(S1)
-
(S1)
stored (BIN 16 bits)
adding/subtracting is stored (BIN 16 bits)
be stored (BIN 16 bits)
→ K-32767 ....... Since bit 15 value is "1",
(8001H)
result of operation takes a negative value.
→ K32766 ........ Since bit 15 value is "0",
(7FFEH)
result of operation takes a positive value.
5 - 30
Constant
Pointer
Level
K
H
P
N
(S2)
(D)
(S2)
(D)
Description
Digit
desig-
Index
nation
: Usable

Advertisement

Table of Contents
loading

Table of Contents