![Delta Electronics AC Motor Drive VFD-E User Manual Download Page 336](http://html1.mh-extra.com/html/delta-electronics/ac-motor-drive-vfd-e/ac-motor-drive-vfd-e_user-manual_2476007336.webp)
Appendix D How to Use PLC Function
|
Revision June 2008, 04EE, SW--PW V1.11/CTL V2.11
D-53
API Mnemonic Operands
Function
21
SUB
P
S
1
, S
2
,
D Subtraction
Bit Devices
Word devices
Program Steps
Type
OP
X Y M K H
KnX KnY KnM T
C
D
S
1
*
*
*
*
*
*
*
*
S
2
*
*
*
*
*
*
*
*
D
*
*
*
*
*
SUB, SUBP: 7 steps
DSUB, DSUBP: 13 steps
Operands:
S1: Minuend S2: Subtrahend D: Remainder
Explanations:
1.
This instruction subtracts S1 and S2 in BIN format and stores the result in D.
2.
The highest bit is symbolic bit 0 (+) and 1 (-), which is suitable for algebraic subtraction.
3.
Flag changes in binary subtraction
In 16-bit instruction:
A. If the operation result
=
0, zero flag M1020 = On.
B. If the operation result
<
-32,768, borrow flag M1021 = On.
C. If the operation result
>
32,767, carry flag M1022 = On.
Program Example:
In 16-bit BIN subtraction:
When X0 = On, the content in D0 will minus the content in D10 and the remainder will be stored in
D20.
X0
SUB
D0
D10
D20
Summary of Contents for AC Motor Drive VFD-E
Page 1: ......
Page 2: ......
Page 3: ......
Page 13: ...This page intentionally left blank...
Page 233: ......
Page 274: ...Appendix B Accessories Revision June 2008 04EE SW PW V1 11 CTL V2 11 B 37...