Delta Electronics AH500 Manual page 155

Motion control module
Hide thumbs Also See for AH500:
Table of Contents

Advertisement

A H 5 00 M o ti on C on tr ol M od ul e Ma nua l
API
Instruction code
23
D
DIV
Devi
X
Y
M
ce
S
1
S
2
D
E xp la nat io n
E xa mple
P
S
K
16#
F
Pulse instruction 16-bit instruction (7 steps) 32-bit instruction (9 steps)
S
: Dividend; S
: Divisor; D: Quotient and remainder
1
2
The singed binary value in S
The quotient and the remainder are stored in D. Users have to notice the
sign bits in S
, S
, and D when 16-bit binary division or 32-bit binary
1
2
division is done.
If the divisor in S
is 0, the instruciton will not be executed.
2
16-bit binary division
S
1
b15..............b0
b15..............b0
/
32-bit binary division
S
S
S
+1
+1
1
1
2
b15.....b0 b15.....b0
b15.....b0 b15.....b0
/
When X0.0 is ON, the dividend in D0 is divided by the divisor in D10, the
quotient is stored in D20, and the remainder is stored in D21. Whether
the quotient and the remainder are positive values or negative values
depends on the leftmost bit in D20 and the leftmost bit in D21.
X0.0
Operand
S
, S
, D
1
2
KnM KnS
D
W
is divided by the signed binary value in S
1
Quotient
S
D
2
b15..............b0 b15..............b0
=
Quotient
S
D
+1
D
2
b15.....b0 b15.....b0 b15.....b0 b15.....b0
=
D IV
D0
D 10
D IV
D0
D 10
Function
Binary division
T
C
V
Z
.
2
Remainder
+1
D
Remainder
D
+3
D
+2
D 20
K 4M 0
5 - 4 0

Advertisement

Table of Contents
loading

Table of Contents