Delta Electronics AH — 3.11 Logic Instructions

Chapter 3 Standard Instructions Graphic expression: 3_ S 1 : Data source 1 S 2 : Data source 2 D : Operation result Explanation: 1. The logical operator XOR takes the binary representations in S 1 and S 2 , and performs the logical exclusive OR operation on each pair of corresponding bits. The operation result is stored in D . 2. Only the instruction DXOR can use the 32-bit counter. 3. The result in each position is 1 if the two bits are different, and 0 if they are the same. Example 1: When X0.0 is ON, the logical operator XOR takes the data in the 16-bit device Y0 and the 16-bit device Y2, and performs the exclusive OR operation on each pair of corresponding bits.

The operation result is stored in Y4. 3-249 FB/FC Instruction Operand Description FC W D* XOR P S , S , D 1 2 Logical exclusive OR operation BOOL WORD DWORD LWORD UINT UDINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S , S 1 2  *  * D  *  * Device X Y M S T C HC/AC D L SM SR E PR K 16# “$” D F S , S 1 2             D           Pulse instruction 16-bit instruction 32-bit instruction AH Motion CPU AH Motion CPU AH Motion CPU