Chapter 16 PLC Function ApplicationsMH300
DIV
BIN division
DIV
Continuous
execution type
DIVP
DDIV
Continuous
execution type
DDIVP
Flag signal: none
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
The 16-bit command operand D occupies two consecutive points.
S1: Dividend. S2: Divisor. D: Quotient and remainder.
Divides S1 by S2 and stores the quotient and remainder in D
method. The sign bit for S1, S2 and D must be kept in mind when performing a
16-bit operation.
16-bit BIN division:
If D is a bit device, K1–K4 can be designated as 16 bits, which occupy two
consecutive units and yield the quotient and remainder.
When X0=ON, stores the quotient resulting from division of dividend D0 by
divisor D10 in D20, and the remainder in D21. The highest bit indicates the sign
of the result.
X0
D0 D10
D20
DIV
D0 D10
K4Y0
DIV