And

This function block performs a logical AND operation on two boolean inputs and outputs a single boolean result. It is used to combine two conditions: the output is True only when both inputs are True.

πŸ“₯ Inputs

  • Boolean (first input) Provide a boolean condition (e.g., result of a comparison or a manual boolean input).

  • Boolean (second input) Provide a second boolean condition to combine with the first.

πŸ“€ Outputs

  • Boolean Result of the AND operation. True when both inputs are True, otherwise False.

πŸ•ΉοΈ Controls

  • No Controls This block has no adjustable widgets. It only evaluates the provided boolean inputs.

βš™οΈ Running mechanism

When the system runs, the block evaluates both boolean inputs and returns a single boolean output. The result reflects the logical AND of the two inputs: True only if both inputs are True. Use comparator blocks or boolean inputs upstream to produce the required boolean signals.

🎯 Features

  • Simple and reliable boolean combination for flow control and triggers.

  • Works with comparator and boolean-producing blocks to build condition logic.

  • Small and lightweight β€” ideal to use inside decision branches or to gate actions.

πŸ“ Usage examples

  • Combine a detection check and a timer: feed a detection comparison (for example, use a Greater block on an Object Count output) into one input and a timing/enable boolean into the other to trigger actions only when both are satisfied.

  • Ensure both inputs are boolean-producing blocks such as Logic Input, comparators (Greater, Smaller, Equals), or other logic blocks (Not, Or).

πŸ’‘ Tips and Tricks

  • To check that an object is present and a safety condition is met: use Object Detection (or Object Detection - Custom) β†’ compare its Object Count with Greater β†’ combine that result with a Safety Equipment Detection check using this And block.

  • For multi-condition checks (more than two conditions), use All True to evaluate a list of boolean values, or chain multiple And blocks.

  • Use Not to invert a condition before feeding into And if you need to require a negative condition (for example, "object present" AND "not alarmed").

  • Use Edge Rising or Rising Edge when you want the And result to trigger only on a signal transition (combine the edge output with another boolean in this block).

  • To toggle outputs (e.g., LEDs or logging) when combined conditions are met, feed this block's output to Led Output, Image Logger, Image Write, or Record Video.

πŸ› οΈ Troubleshooting

  • Unexpected False result: verify both upstream outputs are actual boolean values. Use Logic Input or comparator blocks (Greater, Equals, Smaller) to convert numeric outputs to boolean conditions.

  • Unexpected True result: check that neither input is unintentionally True (e.g., default or uninitialized signals). Use Is None or Data Type Converter earlier in the chain to validate inputs.

  • Need more than two conditions: either chain And blocks or use All True to evaluate a list of boolean values.

Last updated

Was this helpful?