Logic Calculator Configuration

NI Vision Builder

Use Additional Tools

How to Make Pass/Fail Decisions

Use the Logic Calculator step to define Boolean expressions and combine them to form a decision rule.

Defining an Expression

Follow these instructions to define an expression:

  1. In the Step Name control, enter a descriptive name for the step.
  2. In the First Operand frame, select the inspection step or variable type from the Source list you want to be the first operand in your expression.
  3. In the First Operand frame, select the result from the Measure list that you want to use as the first operand. The Current Value indicator displays the value of the measurement based on the current image.
  4. Select the Operator you want to use to compare the first operand to the second operand.
    Tip  You can negate the operator after you add the expression to the Expression table by selecting the expression and clicking Negate.
  5. In the Second Operand frame, select whether the second operand is a constant or the result of another inspection step or a variable value by clicking the appropriate radio button.
    • If you select Constant, enter a value in the corresponding control.
    • If you select Source, select the inspection step or variable type you want to be the second operand in your expression. Also select the operand you want to use.
      Note  The Source list in the Second Operand frame contains only those steps or variables whose measurement types are compatible with the measurement type you selected in the First Operand frame.
  6. Click Add, Insert, or Modify to update the Expression table.

Grouping Expressions

Expressions in the Expression table are grouped with the binary operators AND and OR. By default, the operator AND groups two consecutive expressions. Click AND/OR to change the binary operator.

The AND operator has precedence over the OR operator. If you want to change the precedence of the operators, you can group several expressions using parentheses.

Follow these instructions to group expressions inside a set of parentheses:

  1. In the Expression table, select the first expression you want to group.
  2. Hold down the <Shift> key and select the last expression you want to group.
  3. Click the () button to group all the highlighted expressions by enclosing them in parentheses.

Ungrouping Expressions

Follow these instructions to ungroup expressions by removing a set of parentheses:

  1. In the Expression table, select the first expression in the group. The expression should have an opening parenthesis in the first column of the table.
  2. Hold down the <Shift> key and select the corresponding last expression in the group. The expression should have a closing parenthesis in the sixth column of the table.
  3. Click the () button to ungroup the highlighted expressions and remove their parentheses.

Deleting an Expression

To delete an expression from the Expression table, select the expression and click Delete.