EasyManua.ls Logo

Delta DVP-PM Series - Page 177

Delta DVP-PM Series
561 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
5 Categories and Use of Basic Application Instructions
DVP-PM Operation Instruction
5-40
API Mnemonic Operands Function
23
D DIV P
Division
Controllers
20PM 10PM
Bit Devices Word Devices Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T C D V Z
S
1
* * * * * * * * ***
S
2
* * * * * * * * ***
D
* * *
DIV, DIVP: 7 steps
DDIV, DDIVP: 9 steps
Operands:
S
1
: Dividend S
2
: Divisor D: Quotient and remainder
Explanations:
1. DIV instruction divides S
1
and S
2
in BIN format and stores the result in D. Care should be taken on
positive/negative signs of S
1
, S
2
and D when doing 16-bit and 32-bit operations.
2. When DIV is used as 16-bit instruction, Z device cannot be adopted; when DIV is used as 32-bit instruction, V
device cannot be adopted.
3. DIV will not be executed when the divisor is 0.
4. In 16-bit BIN division:
+1
=/
Quotient
Remainder
S
1
S
2
5. In 32-bit BIN division:
+1
/
=
+1 +1 +3 +2
S
1
S
2
S
1
S
2
Quotient
Remainder
Program Example:
When X0 = ON, D0 will be divided by D10, and the quotient will be stored in D20 while remainder in D21. ON/OFF of
MSB indicates the positive/negative status of the result.
X0
DIV D0 D10 D20
D0 D10 K4Y0
DIV

Table of Contents

Related product manuals