9 Application Instructions API 150-199 API 186 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 3. SA/SX/SC can designate n = 4. EH/EH2/SV/EH3/SV2 can designate n ≦ 4 . 2. S designates KnX, KnY, KnM and KnS; D designates KnY, KnM and KnS. 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 , , . D20 = 46, M1095 = 0, M1089 = 0. D20 = 47, M1095 = 1, M1089 = 0. D20 = 47, M1095 = 1, M1089 = 1. X0 DVP-PLC Application Manual 9-103 Mnemonic Operands Function MBRD P Read Matrix Bit Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F MBRD, MBRDP:
7 steps S * * * * * * * n * * * D * * * * * * * * PULSE 16-bit 32-bit EH3 SV2 ES EX SS SV EH3 SV2 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS SA S X SC EH SV SA SX SC EH MBRDP D0 K3 D20