Mitsubishi — Chapter 8 Application Instructions API 100-149

9 Application Instructions API 150-199 API 187 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 ~ 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 = 46, M1096 = 1, M1089 = 0. X0 DVP-PLC Application Manual 9-105 Mnemonic Operands Function MBWR P Write 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 MBWR, MBWRP:

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 0 MBWRP D0 K3 D20