Delta Electronics AH — 3.11 Logic Instructions

Chapter 3 Standard Instructions Graphic expression: S 1 : Data source 1 3_ Taking LD& and DLD& for example S 2 : Data source 2 Explanation: 1. The instruction is used to compare the data in S 1 with that in S 2 . When the comparison result is not 0, the condition of the instruction is met. When the comparison result is 0, the condition of the instruction is not met. 2. Only the instruction DLD # can use the 32-bit counter. 3. The instruction LD # can be connected to the mother line directly. 4. &: Logical AND operation 5. |: Logical OR operation 6. ^: Logical exclusive OR operation Example: 1.

The logical operator AND takes the data in C0 and C1, and performs the logical AND operation on each pair of corresponding bits. When the operation result is not 0, Y1.0 is ON. 2. The logical operator OR takes the data in D200 and D300, and performs the logical OR operation on each pair of corresponding bits. When the operation result is not 0 and X1.0 is ON, Y1.1 is ON. 3. The logical operator XOR takes the data in C201 and C200, and performs the logical exclusive OR operation on each pair of corresponding bits. When the operation result is not 0, or when X1.1 is ON, Y1.2 is ON.

3-257 FB/FC Instruction Operand Description FC D* LD# S , S 1 2 Contact type of logical operation LD# BOOL WORD DWORD LWORD UINT UDINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S , S 1 2  *  * Device X Y M S T C HC/AC D L SM SR E PR K 16# “$” D F S , S 1 2           Pulse instruction 16-bit instruction 32-bit instruction - AH Motion CPU AH Motion CPU Comparison operation result 16-bit instruction 32-bit instruction ON OFF LD& DLD& ≠ S &S 0 1 2 = S &S 0 1 2 LD| DLD| ≠ S |S 0 1 2 = S |S 0 1 2 LD^ DLD^ ≠ S ^S 0 1 2 = S ^S 0 1 2