Omron CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009 Reference Manual page 410

Programmable controllers
Hide thumbs Also See for CJ - INSTRUCTIONS REFERENCE MANUAL 07-2009:
Table of Contents

Advertisement

Function
/B
/B(434) divides the BCD content of Dd by those of Dr and outputs the quotient to R and the remainder
to R+1.
/BL
/BL(435) divides BCD 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, R+3.
Sample program
0.00
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)
(BCD)
Dd
÷
(BCD)
Dr
(BCD)
R +1
R
Remainder
Quotient
Dd + 1
Dd
÷
Dr + 1
Dr
R + 3
R + 2
R + 1
R
Remainder
Quotient
When CIO 0.00 is ON in the following example, D100 will be
divided by D110 as 4-digit BCD values and the quotient will
D100
be output to D120 and the remainder to D121.
D110
D120
0.00
When CIO 0.00 is ON in the following example, D101 and
D100 will be divided by D111 and D110 as 8-digit BCD values
D100
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: WORD)
/B
Divisor: b (data type: WORD)
Quotient: c (data type: WORD)
a
Remainder: d (data type: WORD)
b
Temporary variable: tmp (data type: WORD, 2-element array)
tmp[0]
MOV
tmp[0]
c
MOV
tmp[0]
d
(BCD)
(BCD)
(BCD)
3. Instructions
3
373

Advertisement

Table of Contents
loading

Table of Contents