6F3B0253
202 T1-16S 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 Register Constant Index
X Y R S T. C. XWYWRWSW T C D I J K
ASource √√√√√√√√√√ √
BCount data √√√√√√
Example
When R020 is ON, the number of ON (1) bits of the register 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) bits = 7
FEDCBA9876543210
D0102 0000000000000111
The result data (7) is stored in binary