Mitsubishi — Chapter 6 Application Instructions API 00-49

6 Application Instructions API 00-49 API 41 Operands: S : Source device to be decoded D : Device for storing the decoded result n : Length of decoded bits Explanations: 1. Range of n when D is a bit device: 1 ~ 8 2. Range of n when D is a word device: 1 ~ 4 3. ES/EX/SS series MPU does not support E, F index register modification. 4. See the specifications of each model for their range of use. 5. The lower “ n ” bits of S are decoded and the results of “2 n ” bits are stored in D . 6. This instruction adopts pulse execution instructions (DECOP) Program Example 1: 1. When D is used as a bit device, n = 1 ~ 8. Errors will occur if n = 0 or n > 8. 2.

When n = 8, the maximum points to decode is 2 8 = 256 points. (Please be aware of the storage range of the devices after the decoding and do not use the devices repeatedly.) 3. When X10 = Off→On, this instruction will decode the content in X0 ~ X2 to M100 ~ M107. 4. When the source of data is 1 + 2 = 3, set M103, the 3 rd bit starting from M100, as 1. 5. After the execution of this instruction is completed and X10 turns to Off, the content that has been decoded and output keeps acting. X10 X2 X1 X0 1 4 1 2 3 3 7 6 5 4 2 1 0 M107 M106 M105 M104 M103 M102 M101 M100 Program Example 2: 1. When D is used as a word device, n = 1 ~ 4. Errors will occur if n = 0 or n > 4. 2.

When n = 4, the maximum points to decode is 2 4 = 16 points. DVP-PLC Application Manual 6-63 Mnemonic Operands Function DECO P Decode Type OP Bit Devices Word Devices Program Steps X Y M S K H Kn X KnY KnM KnS T C D E F DECO, DECOP: 7 steps S * * * * * * * * * * * D * * * * * * * * n * * PULSE 16-bit 32-bit EH3 V SV2 EH3 ES EX SS SA SX SC EH SV EH3 SV2 ES EX SS S A SX SC EH S ES EX SS SA SX SC EH SV SV2 DECOP D1 0 D20 K3 0 1 0 0 0 0 1 0 0 0