Omron CJ - REFERENCE MANUAL 10-2009 Reference Manual page 409

Table of Contents

Advertisement

Function
/U
/U(432) divides the unsigned binary values in Dd by those in Dr and outputs the quotient to R and the
remainder to R+1.
÷
/UL
/UL(433) divides the unsigned binary values in Dd and Dd+1 by those in Dr and Dr+1 and outputs the
quotient to R, R+1 and the remainder to R+2, and R+3.
÷
R + 3
Remainder
Sample program
Example in Function Block Definition
In the following example, an array variable is used to get the quotient and remainder from the function
block.
a / b → c ··· d
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Dd
(Unsigned binary)
Dr
(Unsigned binary)
R+1
R
(Unsigned binary)
Remainder
Quotient
(Unsigned binary)
Dd + 1
Dd
(Unsigned binary)
Dr + 1
Dr
R + 2
R + 1
R
(Unsigned binary)
Quotient
0.00
When CIO 0.00 is ON in the following example, D100 will be
divided by D110 as 4-digit unsigned binary values and the
D100
quotient will be output to D120 and the remainder will be
output to D121.
D110
D120
0.00
When CIO 0.00 is ON in the following example, D100 and
D101 will be divided by D111 and D110 as 8-digit unsigned
D100
hexadecimal values and the quotient will be output to D121
and D120 and the remainder to D123 and D122.
D110
D120
Function Block Variables
Dividend: a (data type: UINT)
/U
Divisor: b (data type: UINT)
Quotient: c (data type: UINT)
a
Remainder: d (data type: UINT)
b
Temporary variable: tmp (data type: WORD, 2-element array)
tmp[0]
MOV
tmp[0]
c
MOV
tmp[0]
d
3. Instructions
3
371

Advertisement

Table of Contents
loading

Table of Contents