Chapter 5 Applied Instructions S 1 : Source device 1; S 2 : Source device 2 The instructions are used to compare the value in S 1 with that in S 2 . Take the instruction AND= for instance. If the comparison result is that the value in S 1 is equal to that in S 2 , the condition of the instruction is met. If the comparison result is that the value in S 1 is not equal to that in S 2 , the condition of the instruction is not met. Explanation The instruction AND ※ is connected to a contact in series. If a 32-bit counter is used, the 32-bit insturciton DAND ※ must be used.
If a 32-bit counter and the 16-bit instruction AND ※ are used, ,a program error will occur, and the ERROR LED indicator on the motion control module will blink. (C200~C255 are 32-bit counters.) When X0.0 is ON and the present value in C10 is equal to K200, Y1.0 is Example ON. When X0.1 is OFF and the value in D0 is not equal to K-10, Y1.1 is set to ON. When X0.2 is ON and the value in (D11, D10) is less than 678,493, or when M3 is ON, M50 is ON.
X0.0 AND= Y1.0 X0.1 AND M50 X0.2 DAND> M3 5-113 API Instruction code Operand Function 232~238 D AND※ S , S 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 Pulse instruction 16-bit instruction (5 steps) 32-bit instruction (7 steps) – 16-bit instruction 32-bit API No. ON OFF instruction 232 AND= DAND= S =S 1 2 S ≠S 1 2 233 AND> DAND> S >S 1 2 S ≦S 1 2 234 AND< DAND< S <S 1 2 S ≧S 1 2 236 AND<> DAND<> S ≠S 1 2 S =S 1 2 237 AND<= DAND<= S ≦S 1 2 S >S 1 2 238 AND>= DAND>= S ≧S 1 2 S <S 1 2 K200 C10 K-10 D0 SET Y1.1 K678493 D10