Skip to content

XOR

Overview

The XOR node (exclusive OR) is a logical gate that returns true if an odd number of its inputs are true. It is commonly used to detect mutually exclusive conditions or state changes.

Use XOR when:

  • Ensuring only one of multiple inputs is active at a time.
  • Detecting a mismatch between two redundant sensors.

💡 Tip

For two inputs, XOR behaves as "one or the other, but not both." For more than two inputs, it acts as a parity check, returning true if the count of true inputs is odd.

Inputs

NameTypeDescription
input_1..input_NboolDynamic boolean input ports to be evaluated.

⚠️ Warning

All configured input ports must be connected for the node to function correctly. If an input is missing, the node will not produce an output.

Outputs

NameTypeDescription
outputboolReturns true if an odd number of inputs are 'true'; otherwise returns false.

Parameters

ParameterDefaultValid valuesTunable
Number of inputs2The whole number (integer) >= 2
Ignore Nothing values as inputsfalsebool
Result when no inputs have valuesfalsebool

Number of inputs

Defines how many boolean input ports the node will provide for evaluation.

Ignore Nothing values as inputs

  • true: Any Nothing value type inputs are ignored.
  • false: If any input is a Nothing value type, the node output is Nothing.

Result when no inputs have values

  • true: When all inputs are Nothing value type, the output is true.
  • false: When all inputs are Nothing value type, the output is false.

Example

Mutually exclusive states

A control system monitors two manual override switches. An alarm should trigger if exactly one switch is active, but not if both are off or both are on.

Configuration:

  • Number of inputs: 2
  • Ignore Nothing values as inputs: false
  • Result when no inputs have values: false

Result: If switch A is true and switch B is false, the XOR output is true.

Reference:

  • OR — returns true if at least one input is true
  • AND — returns true only if all inputs are 'true'
  • Boolean Trigger — blocks or passes data based on an input value (trigger)