Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 409

Table of Contents

Advertisement

Function
*B
*B(424) multiplies the BCD content of Md and Mr and outputs the result to R, R+1.
*BL
*BL(425) multiplies BCD values in Md and Md+1 and Mr and Mr+1 and outputs the result to R, R+1,
R+2, and R+3.
Example Programming
Example in Function Block Definition
In the following example, an array variable is used to get the result from the function block as one word.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Md
Mr
R+1
R
Md + 1
Md
×
Mr + 1
Mr
R + 3
R + 2
R + 1
R
0.00
When CIO 0.00 is ON in the following example, D100
*B
and D110 will be multiplied as 4-digit BCD values and
D100
the result will be output to D121 and D120.
D110
D120
0.00
When CIO 0.00 is ON in the following example, D101,
*BL
D100, D111, and D110 will be multiplied as 8-digit
D100
unsigned BCD values and the result will be output to
D123, D122, D121 and D120.
D110
D120
a * b
c
Function Block Variables
*B
Multiplicand: a (data type: WORD)
a
Multiplier: b (data type: WORD)
b
Result: c (data type: WORD)
Temporary variable: tmp (data type: WORD, 2-element array)
tmp[0]
MOV
tmp[0]
c
(BCD)
(BCD)
(BCD)
(BCD)
(BCD)
(BCD)
3. Instructions
3
373

Advertisement

Table of Contents
loading

Table of Contents