Omron SYSMAC CP Series Instruction & Reference Manual page 264

Cpu unit
Hide thumbs Also See for SYSMAC CP Series:
Table of Contents

Advertisement

2 Instructions
Precautions
• Some time will be required to complete BCNT(067) if a large number of words is specified. Even if an
interrupt occurs, execution of this instruction will not be interrupted and execution of the interrupt task
will be started after execution of BCNT(067) has been completed. One BCNT(067) instruction can
be replaced with two BCNT(067) instructions to help avoid this problem.
Sample Program
When CIO 0.00 is ON in the following example, BCNT(067) counts the total number of ON bits in the 10
words from CIO 100 through CIO 109 and writes the result to D100.
0.00
BCNT
N
&10
S
100
R
D100
2-228
BCNT
&1000
D1000
W0
15
100
10 words
101
to
to
109
BCNT
&500
D1000
W1: Temporary storage
W1
BCNT
&500
D1500
W2: Temporary storage
W2
+
W1
W2
W0
0
Counts the number
of ON bits (35).
0
0
R: D100
CP1E CPU Unit Instructions Reference Manual(W483)
23 hexadecimal
2
3
(35 decimal)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents