3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F or m o r e i nf o r m a t i o n v i s i t : www. e a t o n. c o m
3-447
API Mnemonic
Operands
Function
190
MBC P
S, n, D
Matrix Bit State Count
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C D E
F
S
*
*
*
*
*
*
*
n
*
*
*
D
*
*
*
*
*
*
*
*
MBC, MBCP: 7 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P 32 16 P 32 16
P
Operands:
S
: Matrix source address
n
: matrix length (K1~K256)
D
: result
Description:
1.
This instruction counts the number of 1s or 0s in a matrix of length
n
, and places the result in
D
.
M1098 determines if the instruction counts 1s or 0s. If M1098=0, it counts the number of 0s in
the matrix. If M1098=1, it counts the number of 1s in the matrix.
2. If
S
uses KnX, KnY, KnM and KnS or if
D
uses KnY, KnM and KnS with an ELC-PC/PA/PH, or
a ELCM-PH/PA, n must equal 4. For the ELC-PV n can be 1, 2, 3 or 4.
3. Flags:
When M1099 is ON, this means the result is 0.
When M1098=1, count the number of 1s in the matrix. When M1098=0, count the number of
0s in the matrix.
Program Example:
When X0=ON and M1098=1, the instruction counts the number of 1s in the matrix D0-D2 and saves
the count in D10. When M1098=0, it counts the number of 0s in the matrix D0~D2 and saves the
count in D10.
X0
MBC
D0
K3
D10
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
0
12
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
M1098=0
36
M1098=1
D0
D1
D2
D10
D10
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...