11: B
INARY
A
RITHMETIC
I
NSTRUCTIONS
11-4
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
Examples: DIV
• Data Type: Word
• Data Type: Integer
• Data Type: Double Word
• Data Type: Long
I2
When input I2 is on, data of D10 is divided by data of D20. The
quotient is set to D30, and the remainder is set to D31.
Note:
Destination uses two word operands in the division operation of word data type, so do not use data register D7999
as destination operand D1, other wise a user program syntax error occurs, and the ERROR LED is lit. When using a bit oper-
and such as internal relay for destination, 32 internal relays are required; so do not use internal relay M2521 or a larger
number as destination operand D1.
REP
S2 –
D20
D1 –
D30
S1 –
D10
DIV(W)
Quotient
Remainder
50
D10
÷
7
D30
7
D20
1
D31
I2
REP
S2 –
D20
D1 –
D30
S1 –
D10
DIV(I)
Quotient
Remainder
50
D10
÷
–7
D30
–7
D20
1
D31
Note:
Destination uses two word operands in the division operation of integer data type, so do not use data register
D7999 as destination operand D1, other wise a user program syntax error occurs, and the ERROR LED is lit. When using a
bit operand such as internal relay for destination, 32 internal relays are required; so do not use internal relay M2521 or a
larger number as destination operand D1.
I1
REP
S2 –
D20
D1 –
D30
S1 –
D10
DIV(D)
÷
100000
D10·D11
70000
D20·D21
1
D30·D31
30000
D32·D33
Quotient
Remainder
Note:
Destination uses four word operands in the division operation of double-word data type, so do not use data register
D7997 through D7999 as destination operand D1, other wise a user program syntax error occurs, and the ERROR LED is
lit. When using a bit operand such as internal relay for destination, 64 internal relays are required; so do not use internal
relay M2481 or a larger number as destination operand D1.
I1
REP
S2 –
D20
D1 –
D30
S1 –
D10
DIV(L)
÷
100000
D10·D11
–70000
D20·D21
–1
D30·D31
30000
D32·D33
Quotient
Remainder
Note:
Destination uses four word operands in the division operation of long data type, so do not use data register D7997
through D7999 as destination operand D1, other wise a user program syntax error occurs, and the ERROR LED is lit. When
using a bit operand such as internal relay for destination, 64 internal relays are required; so do not use internal relay
M2481 or a larger number as destination operand D1.
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]