Collapse
CollapsingX
  • - or -

Links


Links allow the creation of expressions using input or output values from other steps in your project. The result of a link can vary every time it is evaluated, since it depends on the current value of the input or output. Note the following restrictions when using links:

  • Only linkable inputs can be linked in expressions.

  • A link to a string is only accepted in string input or in string comparison expressions (see Comparisons).

  • A link to an object is only accepted in object input or in object comparison expressions (see Comparisons).

Link syntax:

  • A simple link is composed of identifiers separated by a period.

    CodeReader.SearchRegion.SizeX
  • To link to an input/output of an object in a collection, the object name should be surrounded by quotations ("…").

    Metrology.Features("Feature1").Status
  • To link to an output of an array element, the index of the element should be specified between brackets (…). The index can be a complex expression with functions, links and sub-expressions. The following example fetches the first, third, and last occurrence of the element:

    ModelFinder.Models("Model0").Occurrences(1).X
    ModelFinder.Models("Model0").Occurrences(1+2).X
    ModelFinder.Models("Model0").Occurrences(ModelFinder.Models("Model0").NumberOfOccurrences).X
  • To link to an output of a multi-dimensional array element, the indices of the element should be specified between brackets (...) and separated by a comma. For example, to get the area of the blob located at coordinates (100.34, 20.78):

    BlobAnalysis.BlobAtPosition(100.34,20.78).Area
  • To link to a variable, the variable name should be prefixed with Variables. For example, to link to a variable named StatusMessage:

    Variables.StatusMessage
  • Similarly, to link to a flowchart parameter, prefix the name of the parameter with Flowchart.

Constant links

A constant link is a link to one of the possible predefined constant values of an input or output. For example, the Speed input of the ModelFinder step accepts 1 of 5 values (such as High, Medium, or Low). In the following image, a constant link to the Speed input's Low value is specified.

You can add a constant link to an expression using the Advanced editor of the Configuration pane; click on one of the possible values listed on the right. For more information, see Using the Advanced editor.

Note that, in some cases, you cannot link to the possible constant values of an output. For example, when configuring a ListBox element in the operator view, you can link to the possible constant values of an input but not those of an output.

Unlike a regular link, a constant link does not change its value during runtime evaluation. The syntax of a constant link is similar to a simple link, but ends with the constant's name:

ModelFinder.Speed.Low