Binding Properties

Bindings are used to animate a Page, and are created between a project tag and a parameter of the interactive Page element. For example, using a Label to display the value of a numeric variable.

When an element is selected in the Page, the element's parameters are displayed in the Properties window. If a parameter has a grey arrow () next to it, it can be bound to a tag.

  1. Click on the grey dot to launch the Expression Builder.

  2. Use the Expression Builder to create an expression that is connected to the control property. In the image above, the expression is a simple tag expression. A more complicated expression can be created, if necessary. Once the expression has been created, the grey dot will change to green to show that the binding is connected.

    Note: if a binding has become invalid (i.e. the tag it was once bound to is deleted), it will become a green circle with a red cross through it.

  3. When Cognex Designer is running, changes in the expression will update the Page control, and for some input controls, updating the Page control will cause the expression to update.

    Note:
    • Expressions associated with a control's bindings remain functional even when the control is disabled. This is a conventional way to display read-only data. If you would like to disable your expression at the same time the control itself is disabled, plan your expression accordingly. For example, create a Boolean tag which gives back True when the control is enabled and False when the control is disabled and use it in an if statement with your expression, or move the expression to a script and manage when it is run from there.
    • Binding updates are throttled to one update, per binding, approximately every 33ms (or roughly 30fps).

      • A Page control will only receive the latest binding's value. For example, if $MyTag was bound to a NumericEntry, and the value was changed from 5 to 10 and then 15 very quickly (faster than 33ms), the NumericEntry will only receive 15 as the updated value.
      • The update speed will be adjusted dynamically if the time taken to update a frame takes longer than approximately 33ms.