To avoid coincidence of the device numbers to be moved designated by the two
Example
operands and cause confusion, please be aware of the arrangement on the
designated device numbers.
3
When S > D, the BMOV command is processed in the order as 1→2→3
X10
When S < D, the BMOV command is processed in the order as 3→2→1
X11
API
ADD
20
D
P
Bit Devices
X
Y
M
K
*
S
1
*
S
2
D
Operands: None
1.
: Summand S
E xplanation
S
1
2.
This instruction adds S
3.
The highest bit is symbolic bit 0 (+) and 1 (-), which is suitable for algebraic
addition, e.g. 3 + (-9) = -6.
4.
Flag changes in binary addition
16-bit command:
A.
B.
C.
16-bit command:
Example
When X0 = On, the content in D0 will plus the content in D10 and the sum will be
stored in D20.
X0
BMOV
D20
D19
BMOV
D10
D11
S1
S2
D
Word Devices
H KnX KnY KnM T
*
*
*
*
*
*
*
*
*
*
*
*
*
: Addend
2
and S
1
If the operation result = 0, zero flag M1020 = On.
If the operation result < -32,768, borrow flag M1021 = On.
If the operation result > 32,767, carry flag M1022 = On.
ADD
Chapter 16 PLC Function |C2000 Series
1
D20
D19
K3
2
D21
D20
3
D22
D21
3
D10
D11
K3
2
D11
D12
1
D12
D13
BIN Addition
16-bit command (7 STEPS)
ADD
C
D
*
*
32-bit command (13 STEPS)
*
*
-
*
*
Flag signal: M1020 Zero flag
D: Sum
in BIN format and store the result in D.
2
D0
D10
D20
16-56
ADDP
-
-
M1021 Borrow flag
M1022 Carry flag
-