FT1A S
MART
A
XIS
U
SER
’
S
M
ANUAL
FT9Y-B1382
11-17
11: D
ATA
C
ONVERSION
I
NSTRUCTIONS
BCNT (Bit Count)
Applicable CPU Modules
Valid Devices
For the valid device address range, see pages 6-1 and 6-2
(Basic Vol.).
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 (TC or CC) is read out. When T (timer) or C (counter) is used as D1,
the data is written in as a preset value (TP or CP) 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 on the CPU module.
When a user program execution error occurs, the execution of the instruction is canceled. The value of D1 is left unchanged and the next instruction
is executed. For user program execution errors, see Chapter 4 “User Program Execution Errors” on page 4-21.
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
When input is on, bits which are on are sought in an array of consecutive bits starting
at the point designated by source device S1. Source device S2 designates the quantity
of bits searched. The quantity of bits which are on is stored to the destination
designated by device D1.
BCNT
S1
*****
D1
*****
S2
*****
FT1A-12
FT1A-24
FT1A-40
FT1A-48
FT1A-Touch
X
X
X
X
X
Device
Function
I
Q
M
R
T
C
D
Constant
Repeat
S1 (Source 1)
First bit to start search
X
X
X
X
—
—
X
—
—
S2 (Source 2)
Quantity of bits searched
X
X
X
X
X
X
X
1-256
—
D1 (Destination 1)
Destination to store quantity of ON bits
—
X
X
X
X
X
—
—
When input is on, bits which are on are sought in an array of 64 bits starting at
internal relay M4 designated by source device S1.
Since 3 bits are on in the searched area, the quantity is stored to data register D100
designated by destination device D1.
D1
D100
S1
M4
I0
BCNT
S2
64
M17
M0
M37
M20
M57
M40
M77
M60
ON
M97
M80
M117
M100
Searched area
3
D100
When input I0 is on, bits which are on are sought in 60 bits starting at bit 0 of data
register D10 designated by device S1.
Since 2 bits are on among the 60 bits, 2 is stored to data register D100 designated by
device D1.
D1
D100
S1
D10
I1
BNCT
S2
60
Bit
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
D10
D11
D12
D13
ON
D14
D15
Searched area
2
D100
Содержание microsmart pentra
Страница 1: ...FT1A SERIES FC9Y B1382 Ladder Programming Manual ...
Страница 6: ...Preface 5 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 104: ...7 DATA COMPARISON INSTRUCTIONS 7 10 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 122: ...8 BINARY ARITHMETIC INSTRUCTIONS 8 18 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 138: ...10 SHIFT ROTATE INSTRUCTIONS 10 12 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 162: ...11 DATA CONVERSION INSTRUCTIONS 11 24 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 188: ...12 CALENDAR COMPARISON INSTRUCTIONS 12 26 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 198: ...15 REFRESH INSTRUCTIONS 15 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 202: ...16 INTERRUPT CONTROL INSTRUCTIONS 16 4 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...
Страница 266: ...20 DUAL TEACHING TIMER INSTRUCTIONS 20 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Страница 318: ...25 USER COMMUNICATION INSTRUCTIONS 25 22 FT1A SMARTAXIS USER S MANUAL FT9Y B1382 ...