Delta C2000 series User Manual page 480

Classical field oriented. control ac motor drive
Hide thumbs Also See for C2000 series:
Table of Contents

Advertisement

Remarks
Flags and the positive/negative sign of the values:
-2, -1, 0
-2, -1, 0 -2,147,483,648
API
SUB
21
D
P
Bit Devices
X
Y
M
K
S
1
S
2
D
Operands: None
1.
: Minuend
E xplanation
S
1
2.
This instruction subtracts S
3.
The highest bit is symbolic bit 0 (+) and 1 (-), which is suitable for algebraic
subtraction.
4.
Flag changes in binary subtraction
In 16-bit instruction:
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.
In 16-bit BIN subtraction:
Example
When X0 = On, the content in D0 will minus the content in D10 and the remainder will
be stored in D20.
X0
16 bit: Zero flag
-32,768
The highest bit
Borrow flag
of the data
= 1 (negative)
32 bit: Zero flag
The highest bit
Borrow flag
of the data
= 1 (negative)
S1
S2
D
Word Devices
H KnX KnY KnM T
: Subtrahend
S
2
SUB
Chapter 16 PLC Function |C2000 Series
Zero flag
-1, 0
1
The highest bit
of the data
= 0 (positive)
Zero flag
-1, 0
1
The highest bit
of the data
= 0 (positive)
Subtraction
16-bit command (7 STEPS)
SUB
C
D
32-bit command (13 STEPS)
Flag signal: M1020 Zero flag
D: Remainder
and S
in BIN format and stores the result in D.
1
2
D0
D10
D20
16-57
Zero flag
32,767
0
1 2
Carry flag
Zero flag
2,147,483,647 0 1 2
Carry flag
SUBP
M1021 Borrow flag
M1022 Carry flag

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents