Delta Electronics Programmable Logic Controller DVP-PLC User Manual
Page 541
![background image](/manuals/75807/541/background.png)
9 Application Instructions API 150-199
DVP-PLC Application Manual
9-69
API Mnemonic
Operands
Function
187
MBWR P
Write 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
*
*
*
*
*
*
*
*
MBWR, MBWRP: 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 ~ M1096. See remarks for more details.
6.
When this instruction is executed, if first determines if the matrix pointer clear flag (M1094) is “On”, If it is “On”,
pointer D is cleared as 0. The instruction then writes the value in the matrix displacement/input complement
flag (M1096) into the location starting from the 0
th
bit of S. Whenever finishing writing 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 writing is processed to the last bit, the matrix search end flag (M1089) will turn “On” and
pointer D records the No. of written bits. If D exceeds its range, M1092 will be On.
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 writing.
2.
Set the Pr value D20 = 45 and M1096 = 1. When X0 goes from Off to On for 1 time, we can obtain the execution
results: D20 = 45, M1096 = 1, M1089 = 0.
X0
MBWRP
D0
D20
K3