1129
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Model Conversion Instructions
3
BCNTC
Function
BCNTC(621) counts the total number of bits that are
ON in all words between S and S+(N–1) and places
the BCD result in R.
Precaution
• S and S+(N-1) must be in the same data area.
Example Programming
When CIO 0.00 is ON in the following example, BCNTC(621) counts the total number of ON bits in the
10 words from CIO 100 through CIO 109 and writes the result to D100.
S+(N–1)
R
to
N words
BCD result
Counts the number
of ON bits.
R: D100
0.00
#0010
100
D100
N
S
R
BCNTC
100
101
109
to to
Counts the number
of ON bits (35).
0035 BCD
35