Chapter 14 PLC Function
|
C200 Series
14-50
API
23
D
DIV
P
S1
S2
D
BIN Division
Bit Devices
Word Devices
X Y M K
H KnX KnY KnM T
C
D
S
1
*
*
*
*
*
*
*
*
S
2
*
*
*
*
*
*
*
*
D
*
*
*
*
*
Operands:
In 16-bit instruction,
D
occupies 2 consecutive devices.
16-bit command (7 STEPS)
DIV
DIVP
32-bit command (13 STEPS)
-
-
-
-
Flag signal: none`
Explanation
1.
S
1
: Dividend
S
2
: Divisor
D
: Quotient and remainder
2. This
instruction
divides
S
1
and
S
2
in BIN format and stores the result in D. Be
careful with the positive/negative signs of
S
1
,
S
2
and D when doing 16-bit and
32-bit operations.
16-bit instruction:
+1
=
/
Quotient
Remainder
If D is the bit device, it allocates K1~K14 to 16-bit and occupies 2 continuous sets
of quotient and remainder.
Example
When X0 = On, D0 will be divided by D10; the quotient will be stored in D20 and
remainder in D21. On/Off of the highest bit indicates the positive/negative value of the
result.
X0
DIV
D0
D10
D20
D0
D10
K4Y0
DIV
Call 1(800)985-6929 for Sales
deltaacdrives.com
sales@deltaacdrives.com
Call 1(800)985-6929 for Sales
deltaacdrives.com
sales@deltaacdrives.com