Subtraction - Delta Electronics AC Motor Drive VFD-E User Manual

Vfd-e high performance/flexible options/micro type ac motor drives
Table of Contents

Advertisement

API
Mnemonic
21
SUB
Type
Bit Devices
OP
X
Y
S
1
S
2
D
Operands:
S1: Minuend
S2: Subtrahend
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.
Revision June 2008, 04EE, SW--PW V1.11/CTL V2.11
Operands
P
S
, S
, D
1
2
Word devices
M
K
H
KnX KnY KnM T
*
*
*
*
*
*
D: Remainder
X0
SUB
Appendix D How to Use PLC Function|
C
D
*
*
*
*
*
*
*
*
*
*
*
*
D0
D10
Function

Subtraction

Program Steps
SUB, SUBP: 7 steps
DSUB, DSUBP: 13 steps
*
*
*
D20
D-53

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents