Mitsubishi — Chapter 6 Application Instructions API 00-49

6 Application Instructions API 00-49 API 11 Operands: S 1 : Lower bound of zone comparison S 2 : Upper bound of zone comparison S : Comparison value D : Comparison result Explanations: 1. If S 1 , S 2 and S are used in device F, only 16-bit instruction is applicable. 2. The content in S 1 should be smaller than the content in S 2 . 3. Operand D occupies 3 consecutive devices. 4. See the specifications of each model for their range of use. 5. S is compared with its S 1 , S 2 and the result is stored in D . 6. When S 1 > S 2 , the instruction performs comparison by using S 1 as the lower/upper bound. 7.

The two comparison values are compared algebraically and the two values are signed binary values. When b15 = 1 in 16-bit instruction or b31 = 1 in 32-bit instruction, the comparison will regard the value as negative binary values. Program Example: 1. Designate device M0, and operand D automatically occupies M0, M1 and M2. 2. When X0 = On, ZCP instruction will be executed and one of M0, M1, and M2 will be On. When X0 = Off, ZCP instruction will not be executed and M0, M1, and M2 remain their status before X0 = Off. 3. To clear the comparison result, use RST or ZRST instruction.

DVP-PLC Application Manual 6-21 Mnemonic Operands Function D ZCP P Zone Compare Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F ZCP, ZCPP: 9 steps DZCP, DZCPP: 17 steps S 1 * * * * * * * * * * * S 2 * * * * * * * * * * * S * * * * * * * * * * * D * * * PULSE 16-bit 32-bit EH3 SV2 ES EH3 EH3 ES EX SS SA SX SC EH SV EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 ZCP K10 K100 C10 M0 M0 If C10 K100, M2 = On ZCP K10 K100 C10 M0 X0 RST M0 RST M1 RST M2 RST M0 RST M2 X0 ZRST M0 M2 RST M1