Logic Operations

This function block evaluates logical and comparison operations over one or more inputs. Use it to combine boolean checks, compare numeric values, or reduce multiple conditions into a single true/false output.

πŸ“₯ Inputs

Generic Accepts any data type. Multiple inputs can be connected and evaluated together.

Generic Accepts any data type. (Second default socket; more inputs may be added)

πŸ“€ Outputs

Boolean The resulting true/false value after evaluating the selected logic or comparison.

πŸ•ΉοΈ Controls

Method Select which logical or comparison operation to apply to the inputs. Common methods include AND, OR, GREATER, SMALLER, EQUALS, and NOT EQUALS.

🎨 Features

Multi-input support Evaluate two or more inputs together, not limited to only two values.

Flexible input types Inputs are generic so you can feed numbers, booleans, lists, or other values depending on your scenario.

Context-aware comparisons Comparison methods work for both pairwise comparisons and for checking the first input against multiple others.

πŸ“ Usage Instructions

  1. Connect one or more values to the inputs. Typical sources are counts, measurement numbers, or boolean signals from other function blocks.

  2. Choose the desired operation from the Method combobox.

  3. The block outputs a single Boolean that represents the result of the selected logical/comparison operation.

Examples:

  • Use Method set to AND when you need all conditions to be true for a pass.

  • Use GREATER when checking whether a measured value is higher than a threshold or higher than multiple reference values.

  • Use EQUALS to verify that several inputs are identical.

πŸ“Š Evaluation Behavior

  • AND returns true only if every input value evaluates to true.

  • OR returns true if any input evaluates to true.

  • GREATER compares the first input against the second; when more inputs are provided, it checks whether the first input is greater than each of the others.

  • SMALLER behaves like GREATER but tests if the first input is lesser.

  • EQUALS returns true when the first input equals all other inputs.

  • NOT EQUALS returns true if any of the other inputs differ from the first input.

πŸ’‘ Tips and Tricks

  • Combine with detection and counting blocks

    • Connect Object Count from Object Detection or Object Detection - Custom to check if an object count is above a threshold using GREATER, then trigger Record Video or Image Logger.

  • Use with tracking results

    • Feed tracking outputs like Position - ID List from Object_Detection_Tracker into this block to create rules such as "is any tracked object present" using OR or NOT EQUALS.

  • Mask / safety logic

    • Combine outputs from Mask Detection or Safety Equipment Detection with AND to assert multiple safety conditions are met before raising an alarm or saving a frame.

  • Pre-checks and flow control

    • Use this block with Is None or Replace None to validate inputs before downstream processing. For example, ensure image data exists and a detector produced results before continuing.

  • Measurement comparisons

    • Feed numeric outputs from Measure Position Distance, Get Dimension, or Mean Value of Image to GREATER/SMALLER methods to create pass/fail conditions for quality checks.

  • Use in automation flows

    • Chain the boolean result to Led Output, Write Text On Image, CSV Export, or MQTT Publish to act on detection or measurement outcomes.

πŸ› οΈ Troubleshooting

  • Unexpected false results

    • Check the data types flowing into the inputs. Convert or normalize values (for example, use Round or String Operations) so comparisons behave as expected.

  • Comparisons with multiple inputs behave differently

    • Remember that GREATER and SMALLER compare the first input against the others. If you need pairwise comparisons, feed appropriate pairs or use multiple Logic Operations blocks.

  • No output or stuck flow

    • Ensure at least one input is connected or valid. Use Is None or Replace None to guard against missing values.

Last updated

Was this helpful?