Table of Contents

Advertisement

BCNT

Instruction
BIT COUNTER
Symbol
Applicable Program Areas
Function block
Area
definitions
Usage
OK
Operands
Operand
N
Number of words
S
First source word
R
Result word
N: Number of words
The number of words must be 0001 to FFFF (1 to 65,535 words).
Operand Specifications
Area
CIO
WR
HR
N
S
OK
OK
OK
R
Flags
Name
Error Flag
Equals Flag
Function
BCNT(067) counts the total number of bits that are
ON in all words between S and S+(N-1) and places
the result in R.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Mnemonic
Variations
BCNT
@BCNT
Block program areas
Step program areas
OK
OK
Description
Word addresses
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
ER
• ON if N is 0000.
• ON if result exceeds FFFF.
• OFF in all other cases.
=
• ON if the result is 0000.
• OFF in all other cases.
Function
code
Counts the total number of ON bits in the specified
067
word(s).
BCNT
BCNT(067)
N
N: Number of words
S
S: First source word
R: Result word
R
Subroutines
OK
Data type
UINT
UINT
UINT
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
OK
OK
OK
OK
---
---
OK
Operation
to
S+(N–1)
T
3. Instructions
Function
SFC action or
Interrupt tasks
transition programs
OK
OK
Size
1
Variable
1
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
---
N words
Counts the number
of ON bits.
Binary result
R
3
TR
bits
---
465

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents