Mitsubishi Electric M800VW Series Programming Manual page 198

Plc programming
Hide thumbs Also See for M800VW Series:
Table of Contents

Advertisement

M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.2 Arithmetic Operation Instructions
D+, D+P, D-, D-P: BIN 32-bit addition and subtraction operations (Device at storage destination: Indepen-
dent type)
Setting
Bit devices
data
X
Y
M
L
F
S1
S2
D
△: S1 and S2 cannot be specified as constant at the same time.
[Instruction symbol] [Execution condition]
D+, D-
D+P, D-P
 Setting data
Setting data
Data to be added to or subtracted from, or the first number of the device storing
S1
such data
Addition or subtraction data, or number of device storing addition or subtraction
S2
data
D
The head No. of the device which stores the results of addition or subtraction
 Functions
D+
 Adds 32-bit BIN data designated by (S1) to 32-bit BIN data designated by (S2), and stores the result of the addition at the
device designated by (D).
S1+1
S1
b31
b16
b15
b0
567890 (BIN)
+
 The values for (S1), (S2) and (D) can be designated between -2147483648 and 2147483647 (BIN 32 bits).
 The judgment of whether data is positive or negative is made by the most significant bit (b31).
b31
Judgment (+/-)
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.
- By the operation below, b31 is "1" and the result is a negative value.
K2147483647 (H7FFFFFFF) + K2 (H0002) = K-2147483647 (H80000001)
- By the operation below, b31 is "0" and the result is a positive value.
K-2147483648 (H80000000) + K-2 (HFFFE) = K2147483646 (H7FFFFFFE)
Usable devices
B SB
T SM V
T
C
Command
Command
Meaning
S2+1
S2
b31
b16
b15
b0
123456 (BIN)
Word devices
stant
D
R/ZR W SW SD
Z
K
D+1
D
b31
b16
b15
b0
691346 (BIN)
177
Digit
Con-
Pointer
designa-
Index
tion
H
P
indicates the signs D+ / D-
S1 S2
D
P
S1 S2
D
Data type
BIN 32 bits
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents