Logic
The Logic block combines Boolean conditions and returns their shared result. Use it when a decision depends on multiple conditions.
Typical use cases
- Combine multiple conditions before a branch.
- Check whether at least one condition is met.
- Activate an output only when every input is
true. - Negate conditions or check for an odd number of true values.
Inputs
The block starts with the two Boolean inputs a and b. Use the + and − controls to add or remove inputs.
| Operator | Minimum inputs | Maximum inputs |
|---|---|---|
AND, OR, XOR, NAND, NOR | 2 | 10 |
NOT | 1 | 10 |
Each input accepts either a connected Boolean value or a fixed value selected directly in the block. New inputs default to false. Connecting an input disables its local selector.
Inputs are labelled alphabetically from a through j. Removing an input also removes its connections.
Operators
| Operator | Result |
|---|---|
AND | true when every input is true. |
OR | true when at least one input is true. |
XOR | true when an odd number of inputs are true. |
NAND | Negated AND; only false when every input is true. |
NOR | Negated OR; only true when every input is false. |
NOT | Inverts every input separately. |
Truth table for two inputs
a | b | AND | OR | XOR | NAND | NOR |
|---|---|---|---|---|---|---|
false | false | false | false | false | true | true |
false | true | false | true | true | true | false |
true | false | false | true | true | true | false |
true | true | true | true | false | false | false |
With more than two inputs, XOR acts as a parity check: its result is true when an odd number of inputs are true.
NOT preview
The NOT operator inverts every input separately and provides an individual output for each input.
Outputs
For AND, OR, XOR, NAND and NOR, the block has one Boolean output named Value, containing the combined result.
With NOT, every input has a separate output:
| Input | Output | Result |
|---|---|---|
a | Not a | !a |
b | Not b | !b |
c–j | Not c–Not j | Inverted value of the corresponding input. |
Configuration
- Select the required operator from the dropdown.
- Set the required number of inputs with + or −.
- Connect Boolean values to the inputs or select fixed values.
- Connect
Value, or the requiredNot …outputs, to the next blocks.
Example: alarm condition
An alarm should only be activated when the system is armed and a window is open:
- Select
AND. - Connect the “system armed” state to
a. - Connect the “window open” state to
b. - Connect
ValuetoConditionon an IF Else block.
Only when both inputs are true does Value return true.
Notes and troubleshooting
- The block only accepts Boolean inputs and only produces Boolean outputs.
- After switching to
NOT, make sure the required individual output is connected. - With three or more inputs,
XORmeans “an odd number are true”, not “exactly one is true”. - Check disconnected inputs: their locally selected values still affect the result.
Related blocks
- IF Else — selects a program branch from a Boolean result.
- Compare Values — creates a Boolean condition from two numeric values.