Using Expressions

An expression in Jobs is a combination of explicit values, variables, operators and functions (see: Wikipedia). It is typically in the form of an assignment (variable = expression) whereby a value is computed (by evaluating the expression on the right side) and assigned to a variable (on the left side). Expression is evaluated and assigned to the variable when the task is executed.

Expression use case 
In the following text we show an example which uses an expression. Imagine that we want to capture random positions on a dish. We want to finish capturing when we gather 3000 objects.

First of all we have to define our capture using the Acquisition > Capture Definition. We choose the optical configuration and insert the System > Variables task which we set as follows:

Then we insert the Stage XY Points > Generate Points task, define the dish area on the stage and adjust point generating parameters as shown in the following picture.

Finally we insert the point loop (Stage XY Points > Loop over Points) and fill it with Acquisition > Capture, Analysis > Cell Count Analysis, System > Expression and Conditions > Condition (If).

Double-clicking on the analysis task we can further define its parameters (see Cell Count Analysis).

In the task expression we enter the following expression: TotalCells = TotalCells + Job.CellCount.Count

Into the Conditions > Condition (If) task we define the following condition: TotalCells > 3000. Inside the condition we insert a Break (Conditions > Break). Thus if the condition is true (we receive 3000 objects), the whole job stops.

The final job looks as follows:

For more information about Jobs Progress and Results window, please see Job Execution Progress window and Running a Job, Viewing Results and Graphs.