Mitsubishi — 5.6 Application Instructions

5 Categories and Use of Basic Application Instructions API 10 Operands: S 1 : Comparison value 1 S 2 : Comparison value 2 D : Comparison result Explanations: 2. When CMP is used as 16-bit instruction, Z device cannot be adopted; when CMP is used as 32-bit instruction, V 1. The contents of S 1 and S 2 are compared and D stores the comparison result. device cannot be adopted. 3. D will occupy 3 consecutive devices. D , D +1, D +2 hold the comparison results: D = ON if S 1 > S 2 , D +1 = ON if S 1 = S 2 , D +2 = ON if S 1 S 2. Program Example: 1. If D is set as Y0, then Y0, Y1, Y2 will display the comparison results as shown below.. 2.

When X10 = ON, CMP instruction is executed and one of Y0, Y1, Y2 will be ON. When X10 = OFF, CMP instruction is not executed and Y0, Y1, Y2 remain in their previous condition. 3. If you need to obtain a comparison result with , and ≠ ≧≦ , make a series/parallel connection between Y0 and Y2. X10 DVP-PM Application Manual 5-23 Mnemonic Operands Function Controllers 20PM 10PM D CMP P Compare Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D V Z CMP, CMPP: 7 steps DCMP, DCMPP: 9 steps S 1 * * * * * * * * * * * D S 2 * * * * * * * * * * * D * * * CMP K10 D10 Y0