XOR / XORN

PLCopen motion icon

Operator - Performs an exclusive OR of all inputs.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN1

BOOL

 

 

 

First Boolean input.

IN2

BOOL

 

 

 

Second Boolean input.

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

 

 

Exclusive OR of all inputs.

Remarks

Truth Table

IN1 IN2 Q

0

0

0

0

1

1

1

0

1

1

1

0

FBD Language Example

FFLD Language Example

  • The first input is the rung.
  • The rung is the output.

IL Language Example

Op1: FFLD   IN1
     XOR  IN2
     ST   Q   (* Q is equal to: IN1 XOR IN2 *)
Op2: FFLD   IN1
     XORN IN2
     ST   Q   (* Q is equal to: IN1 XOR (NOT IN2) *)

ST Language Example

Q := IN1 XOR IN2;
Q := IN1 XOR IN2 XOR IN3;

See Also