AH500 Motion Control Module Manual S 1 : Source device 1; S 2 : Source device 2 The instruction is used to compare the value in S 1 with that in S 2 . If the comparison result is not 0, the condition of the instruction is met. If the comparison result is 0, the condition of the instruction is not met. The instruction AND# is connected to a contact in series. Explanation &: Logical AND operation |: Logical OR operation ^: Logical exclusive OR operation If a 32-bit counter is used, the 32-bit instruction 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, a logical AND operator takes the values in C0 and C10, and performs the logical AND operation on each pair of corresponding bits. If the operation result is not 0, Y1.0 will be set to ON. When X0.1 is OFF, a logical OR operator takes the values in D10 and D0, and performs the logical OR operation on each pair of corresponding bits. If the operation result is not 0, Y1.1 will be ON. When X0.2 is ON, a logical XOR operator takes the values in (D201, D200) and (D101, D100), and performs the logical exclusive OR operation on each pair of corresponding bits. If the operation result is not 0, or if X0.3 is ON, M50 will be ON.
Example Y1.0 X0.0 X0.1 X0.2 M50 M3 5-110 API Instruction code Operand Function 218~220 D AND# S , S 1 2 Logical operation 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 32-bit API No. ON OFF instruction instruction 218 AND& DAND& S 1 & S 2 ≠0 S 1 & S 2 = 0 219 AND| DAND| S 1 | S 2 ≠0 S 1 | S 2 = 0 220 AND^ DAND^ S 1 ^ S 2 ≠0 S 1 ^ S 2 = 0 AND& C0 C10 AND I D10 D0 SET Y1.1 DAND^ D200 D100