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 emitsfalse - 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 becomesfalse - if all connected inputs have the last known logical value
true, the output becomestrue
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:
nullbefore the first result is calculatedtruewhen the last calculated result had the logical value truefalsewhen 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, andtrue, then the output becomestrue. - If three inputs are connected to the block and one of the values changes to
false, then the output becomesfalse. - If the currently received change has the value
true, but one of the remaining inputs has not yet sent the logical valuetrue, then the output becomesfalse. - If one of the inputs sends a number, text, or
null, that input does not meet the logicaltruecondition, so the output becomesfalse. - If
filter_duplicated_values = trueand subsequent input changes still lead to the resulttrue, the block does not emittrueagain. - If
filter_duplicated_values = falseand subsequent input changes still lead to the resulttrue, the block emitstrueagain after each such change.