AH500 Motion Control Module Manual S 1 : Comparison value 1; S 2 : Comparison value 2; D : Comparison result The instruction is used to compare the value in S 1 with that in S 2 . The comparison result is stored in D . The operand D occupies three consecutive devices. Explanation If the operand D is Y0.0, Y0.0, Y0.1, and Y0.2 will be occupied automatically. When X1.0 is ON, the instruction CMP is executed, and Y0.0, Y0.1, or Y0.2 is ON. When X1.0 is OFF, the execution of the instruction CMP stops, and the states of Y0.0, Y0.1, and Y0.2 remain unchanged . Example If users want to get the result that K10 ≧ the value in D10, they have to connect Y0.0 and Y0.1 in series.
If users want to get the result that K10 ≦ the value in D10, they have to connect Y0.1 and Y0.2 in series. If users want to get the result that K10≠the value in D10, they have to connect Y0.0, Y0.1, and Y0.2 in series. 5-28 API Instruction code Operand Function 10 D CMP P S , S , D 1 2 Comparing values Device Xn.n Yn.n M S K 16# F KnM KnS D W T C V Z S 1 S 2 D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction ( 9 steps) X1 .0 CMP K10 D10 Y0.0