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
Connect one or more values to the inputs. Typical sources are counts, measurement numbers, or boolean signals from other function blocks.
Choose the desired operation from the
Methodcombobox.The block outputs a single
Booleanthat represents the result of the selected logical/comparison operation.
Examples:
Use
Methodset 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 CountfromObject DetectionorObject Detection - Customto check if an object count is above a threshold using GREATER, then triggerRecord VideoorImage Logger.
Use with tracking results
Feed tracking outputs like
Position - ID ListfromObject_Detection_Trackerinto this block to create rules such as "is any tracked object present" using OR or NOT EQUALS.
Mask / safety logic
Combine outputs from
Mask DetectionorSafety Equipment Detectionwith 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 NoneorReplace Noneto 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, orMean Value of Imageto 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, orMQTT Publishto 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
RoundorString 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 NoneorReplace Noneto guard against missing values.
Last updated
Was this helpful?