Operator - Performs an exclusive OR of all inputs.
IN1 : BOOL First boolean input
IN2 : BOOL Second boolean input
Q : BOOL Exclusive OR of all inputs
IN1 |
IN2 |
Q |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
The block is called "=1" in FBD and LD languages. In IL language, the XOR instruction performs an exclusive OR between the current result and the operand. The current result must be boolean. The XORN instruction performs an exclusive between the current result and the boolean negation of the operand.
Q := IN1 XOR IN2;
Q := IN1 XOR IN2 XOR IN3;
(* First input is the rung.
The rung is the output *)
Op1: LD IN1
XOR IN2
ST Q (* Q is equal
to: IN1 XOR IN2 *)
Op2: LD IN1
XORN IN2
ST Q (* Q is equal
to: IN1 XOR (NOT IN2) *)