153
D D V
I
P
S1
S2
D
FNC
23
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
S2
D
1
2
M
3
○ ○ ○○
If the divisor is equal to “0”, the PLC will regard that as an operational error.
The quotient will automatically be positive when it is the result of operating a positive dividend and a positive
divisor, or a negative dividend and a negative divisor; If either of a dividend or divisor is positive and the other
is negative, the quotient will automatically be a negative.
A positive dividend produces a positive remainder, while a negative dividend produces a negative remainder.
S1 : the dividend
S2 : the divisor
D : the quotient and remainder
Note
D0
D1
D2
D3
(D1, D0)
(D3, D2)
(D5, D4)
(D7, D6)
27
÷
DDIVP D0 D2 D4
X20
÷
When X20 = “OFF” → “ON”, the dividend (D1, D0) will be divided by the divisor (D3, D2), and the quotient will be
stored at the destination device (D5, D4) while the remainder will be stored in (D7, D6).
DI VP D0 D1 D2
X20
S1
S2
D
S1 S2
D
In case of the 32-bit instruction is used, a 32-bit quotient and a 32-bit remainder are produced. The Most
Significant Bit of a component will indicate a positive or negative (“0” represents it is positive; “1” negative).
When the quotient of an operation stores in the and it is equal to “0”, the Multiplication / Division Zero Flag
.
M9023 turns “ON”
When the quotient of an operation exceeds 2,147,483,647, the Division Overflow Flag M9025 turns “ON”.
10
1
3
3
3
300
11
Operand
Devices
Division (S1)÷(S2) → (D),(D+1)
When X20= “OFF” → “ON” , the dividend (D0) will be divided by the divisor (D1), and the quotient will be stored at
the destination device (D2) while the remainder will be stored in (D3).
Quotient
Remainder
Quotient
Remainder
In case of the 16-bit instruction, a 16-bit quotient and a 16-bit remainder are produced. The Most Signicant Bit of
a component will indicate a positive or negative (“0” represents it is positive; “1” negative).
When the quotient of an operation stores in the and it is equal to “0”, the Multiplication / Division Zero Flag
M9023 turns “ON”.
When the quotient of an operation exceeds 32,767, the Division Overow Flag M9025 turns “ON”.
D
S2
D