beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 539

background image

9 Application Instructions API 150-199

DVP-PLC Application Manual

9-67

API Mnemonic

Operands

Function

186

MBRD P

Read Matrix Bit

Controllers

ES/EX/SS SA/SX/SC EH/SV

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

*

*

*

*

*

*

*

*

MBRD, MBRDP: 7 steps

PULSE 16-bit 32-bit

ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV

Operands:

S: Matrix source device n: Array length D: Pointer (Pr), for storing the value of target location

Explanations:

1. Range

of

n: K1 ~ K256

2.

S designates KnX, KnY, KnM and KnS; D designates KnY, KnM and KnS.

3.

SA/SX/SC can designate n = 4. EH/EH2/SV can designate n

4

≦ .

4.

See the specifications of each model for their range of use.

5.

Flags: M1089 ~ M1095. See remarks for more details.

6.

When this instruction is executed, it first determines if the matrix pointer clear flag (M1094) is “On”. If it is “On”,

pointer D is cleared as 0. The instruction then reads the On/Off status from the 0

th

bit of S to the matrix

rotation/displacement/output carry flag (M1095). Whenever finishing reading 1 bit, the instruction determines

whether the matrix pointer increasing flag (M1093) is “On”. If it is “On”, the value of pointer D will plus 1. When

the reading is processed to the last bit, the matrix search end flag (M1089) will turn “On” and pointer D record

the No. of read bits.

7.

The Pointer (Pr) of the matrix is designated by the user in the instruction. The vaild range of Pr is 0 ~ 16n -1,

corresponding to b

0

~ b

16n-1

in the matrix. If the Pr value exceeds its range, M1092 will be On and the instruction

will not be executed.

Program Example:

1.

When X0 goes from Off to On, M1094 will be set to “0” and M1093 to “1”. Therefore, the Pr will plus 1 after

every reading.

2.

Set the Pr value D20 = 45. When X0 goes from Off to On for 3 times, we can obtain the 3 execution results

n,

o, p.

n D20 = 46, M1095 = 0, M1089 = 0.

o D20 = 47, M1095 = 1, M1089 = 0.

p D20 = 47, M1095 = 1, M1089 = 1.

X0

MBRDP

D0

D20

K3