6F3B0250
220 T1/T1S User’s Manual
7. Instructions

FUN 122 BC Bit count

Expression
Input -[
A
BC
B
]- Output
Function
When the input is ON, this instruction counts the number of ON (1) bits of
A
, and stores the result in
B
.
Execution condition
Input Operation Output
OFF No execution OFF
ON Execution ON
Operand
Name Device Re
g
ister Constant Index
X Y R S T. C. XW YW RW SW T C D I J K
A
Source ÖÖÖÖÖÖÖÖÖÖ Ö
B
Count data ÖÖÖÖÖÖ
Example
When R020 is ON, the number of O N ( 1 ) bits of the reg ist er RW032 is counted, and the result is
stored in D0102.
The following figure shows an operation example.
FEDCBA9876543210
RW0320010011101011000
Counts the number of ON (1) bit s = 7
FEDCBA9876543210
D0102 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1
The result data (7) is stored in binary
T1S only
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net