Expression Builder

 

The Expression Builder allows you to create simple expressions, which are normally used for binding Web Page elements (typically constructed in the Web Page Editor).

For example, in your application, you want to decide whether or not to display an image based on an "if" condition, which marks the threshold between a good or bad product. You can construct a simple expression for this using the Expression Builder Language Elements.

Note:
  • The Expression Builder dialog's label always marks the field being bound, and the data type for that field.
  • When starting, the "No binding" error message is present, by default.
ControlDescription
HelpDisplays the Cognex Designer User's Guide
ValidateChecks the validity of the expression.
Associations

Maps the expression's return type to the type required by the binding, e.g. a number to a color.

Note: For more information, please see the Binding Associations topic.
Tag SelectorLaunches the Tag Selector dialog, which displays the list of available tags.
TagShows the list of available tags.
ConstantShows the list of the available constant values.
FunctionShows the list of the available functions.
...Shows the list of all functions, tags, and constants.
Result It attempts to evaluate the expression and returns the resulting value. If there are errors, it provides quick feedback on possible syntax errors. This element is only visible (can be collapsed still) if the entered expression is invalid. If collapsed, the parser error is shown as a tooltip.