3. Instruction

Set

API

Mnemonic

 

 

Operands

 

 

Function

 

 

Controllers

 

190

 

MBC

P

 

 

 

 

Matrix bit status count

ES2/EX2 SS2 SA2 SX2

 

 

 

 

 

SE

 

 

Type

Bit Devices

 

 

 

Word devices

 

 

 

Program Steps

 

OP

 

X

Y

M

S

K

H KnX KnY KnM KnS T

C

D

E

F MBC, MBCP: 7 steps

 

 

S

 

 

 

 

 

*

*

*

*

*

*

*

 

 

 

 

n

 

 

 

 

*

*

 

 

 

 

 

*

 

 

 

 

D

 

 

 

 

 

 

*

*

*

*

*

*

*

*

 

 

 

 

 

 

 

 

 

 

PULSE

 

 

 

 

16-bit

32-bit

 

 

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

ES2/EX2

SS2

SA2

SX2

 

SE

SE

SE

Operands:

 

 

 

 

 

 

 

 

 

 

S: Matrix source device n: Matrix length (K1~K256)

D: Operation result

 

 

Explanations:

1.MBC instruction counts the number of bit 1 or bit 0 in the matrix with matrix length n and stores the counted number in D.

2.If operands S or D use KnX, KnY, KnM, KnS format, only n = 4 is applicable.

3.When M1098 = ON, MBC instruction counts the number of bit 1. M1098 = OFF, MBC counts the number of bit 0. If bits counting result is 0, M1099 = ON

4.Associated flags:

M1098: Counting the number of bits which are “1” or “0”

M1099: ON when the bits counting result is “0”..

Program Example:

When X0 = ON with M1098 = ON, MBC instruction counts the number of bit 1 in D0~D2 and store the counted number in D10. When X0 = ON with M1098 = OFF, the instruction counts the number of bit 0 in D0~D2 and store the counted number in D10.

X0

 

 

 

MBC

D0

K3

D10

D0

1 1 1 1

1 1

1 1 1 1 0 0 0 0 1 1

D1

1 1 1 1

1 1

1 1 1 1 0 0 0 0 1 1

D2

1 1 1 1

1 1

1 1 1 1 0 0 0 0 1 1

D10 12 M1098=0

D10 36 M1098=1

3 - 4 2 3

Page 539
Image 539
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual D10 12 M1098=0 D10 36 M1098=1