Skip to content

and

Description

The and block performs a logical AND operation on multiple boolean input signals. It returns true at the output only when the currently received input value is logical true and all other connected inputs have the last known logical value true. In every other case, it returns false.

The block has one output and allows multiple connections to its input. It does not require the use of inputs labeled with the tag block.

The block analyzes the currently received change and the last known values of the remaining connected inputs. As a result, the output matches the logical AND operation performed on the currently known states of all inputs.

Configuration parameters

Parameter name Value
Block duplicated value (filter_duplicated_values) Required boolean value true or false. When set to true, the block does not emit the same result again if it is identical to the last emitted one. When set to false, each recalculated result is sent to the output even if the result has not changed compared with the previous one.

Input handling

The block allows multiple connections to its only input.

Each new input change causes the result to be recalculated according to the following rules:

  • if the just received value is not logical true, the block immediately emits false
  • if the just received value is logical true, the block checks the last known values of all remaining connected inputs
  • if at least one of those remaining inputs does not have the last value logical true, the output becomes false
  • if all connected inputs have the last known logical value true, the output becomes true

The block reacts only to logical true values as the condition for setting the result to true. Values false, null, and values of other types do not meet this condition and are treated as the absence of the true state on a given input.

Ignored cases:

  • recalculation of the same result when filter_duplicated_values = true

Block outputs

The block has one output.

The output carries the logical value:

  • true when the currently received value and the last known values of all remaining inputs are logical true
  • false when at least one input does not have the logical value true

The description shown below the block reflects the last calculated result:

  • null before the first result is calculated
  • true when the last calculated result had the logical value true
  • false when the last calculated result had the logical value false

Errors visible to the user

The block can display the following error messages:

Error code Error description
Missing filter_duplicated_values configuration. The filter_duplicated_values parameter is missing in the configuration or the parameter cannot be read as a boolean value.
Input disconnected. No other block is connected to the block input.

Examples

  • If three inputs are connected to the block and their last known values are true, true, and true, then the output becomes true.
  • If three inputs are connected to the block and one of the values changes to false, then the output becomes false.
  • If the currently received change has the value true, but one of the remaining inputs has not yet sent the logical value true, then the output becomes false.
  • If one of the inputs sends a number, text, or null, that input does not meet the logical true condition, so the output becomes false.
  • If filter_duplicated_values = true and subsequent input changes still lead to the result true, the block does not emit true again.
  • If filter_duplicated_values = false and subsequent input changes still lead to the result true, the block emits true again after each such change.