EasyManuals Logo
Home>IDEC>Controller>FC4A-C16R2

IDEC FC4A-C16R2 User Manual

IDEC FC4A-C16R2
525 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #265 background imageLoading...
Page #265 background image
14: DATA CONVERSION INSTRUCTIONS
« FC4A MICROSMART USERS MANUAL » 14-13
BCNT (Bit Count)
Applicable CPU Modules
Valid Operands
For the valid operand number range, see pages 6-1 and 6-2.
Internal relays M0 through M1277 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S2, the timer/counter current value is read out. When T (timer) or C (counter) is
used as D1, the data is written in as a preset value which can be 0 through 65535.
Valid values for S2 to designate the quantity of bits searched are 1 through 256. Make sure that the search area designated
by S1 plus S2 is within the valid value range. If the source data is out of the valid range, a user program execution error
will result, turning on special internal relay M8004 and the ERR LED.
Since the BCNT instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction
should be used as required.
Examples: BCNT
FC4A-C10R2/C FC4A-C16R2/C FC4A-C24R2/C FC4A-D20K3/S3 FC4A-D20RK1/RS1 & FC4A-D40K3/S3
——— X
Operand Function I Q M R T C D Constant Repeat
S1 (Source 1) First bit to start search XXXXX
S2 (Source 2) Quantity of bits searched XXXXXXX 1-256
D1 (Destination 1) Destination to store quantity of ON bits X XXXX
When input is on, bits which are on are sought in an array of consecu-
tive bits starting at the point designated by source operand S1. Source
operand S2 designates the quantity of bits searched. The quantity of
bits which are on is stored to the destination designated by operand D1.
BCNT S1
*****
D1
*****
S2
*****
D1
D100
S1
M4
I0
BCNT
M17 M0
M37
M20
M57
M40
M77
M60
M97
M80
M117
M100
ON
Searched area
3
D100
S2
64
When input is on, bits which are on are sought in an array of 64 bits
starting at internal relay M4 designated by source operand S1.
Since 3 bits are on in the searched area, the quantity is stored to data
register D100 designated by destination operand D1.
D1
D100
S1
D10
I1
BNCT
Bit 15 14 13 12 11 10 9876543210
D10
D11
D12
D13
D14
D15
When input I0 is on, bits which are on are sought in 60 bits starting
at bit 0 of data register D10 designated by operand S1.
Since 2 bits are on among the 60 bits, 2 is stored to data register
D100 designated by operand D1.
ON
Searched area
2
D100
S2
60

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IDEC FC4A-C16R2 and is the answer not in the manual?

IDEC FC4A-C16R2 Specifications

General IconGeneral
BrandIDEC
ModelFC4A-C16R2
CategoryController
LanguageEnglish

Related product manuals