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
Summary of Contents for DVP-10PM
Page 1: ......
Page 45: ...2 Hardware Specifications and Wiring DVP PM Application Manual 2 30 MEMO...
Page 125: ...3 Functions of Devices in DVP PM DVP PM Application Manual 3 80 MEMO...
Page 341: ...8 Application Examples DVP PM Application Manual 8 2 Trajectory 3 Trajectory 4...
Page 427: ...9 Electrical CAM DVP PM Application Manual 9 74...
Page 437: ...10 Encrypting User Program DVP PM Application Manual 10 10 MEMO...
Page 458: ...11 G code Application DVP PM Application Manual 11 21 B O100 main program...
Page 561: ...14 Appendix DVP PM Application Manual 14 4 MEMO...