# How the trial control instructions are executed

When EthoVision XT evaluates conditions and actions

During a Trial, EthoVision XT evaluates the Trial Control Settings selected for that trial, and checks the state of conditions and actions at each sample time. Note that the sample time depends on the chosen sample rate, not on the video frame rate.

How EthoVision XT evaluates conditions and actions

The program remembers which Trial Control box was evaluated (active) in the previous sample. Depending on the type of this box:

▪For a Condition box. EthoVision XT checks whether the condition at the current sample time is met. If it is not, the condition becomes false. The program waits until the condition is met. When this happens (condition becomes true; see 3 in the figure below), the program passes control to the next box in the sequence. The condition becomes then inactive (see 4).

▪For an Action box. EthoVision XT carries out the action, and passes control to the next box, which becomes active. Then, the Action box becomes inactive (see 4-5).

▪For sub-rules and sub-rule references, see the EthoVision XT 19 - Trial and Hardware Control - Reference Manual.

When a box becomes active, the previous becomes inactive.

Notes

▪Boxes combined in parallel using operators are evaluated at the same sample time, in unspecified order. This means that one cannot establish which condition is evaluated/which action is taken first.

▪Actions on Trial Control variables are executed immediately. Actions on hardware devices are executed when all boxes that must be evaluated at that sample time have been evaluated.

▪If a box being evaluated contains a condition that is immediately true, the program passes control to the next box. Therefore, within one sample time the program can pass control to two or more boxes to the right.

▪When you stop the trial or the Maximum trial duration has been reached, all Trial Control boxes are deactivated and hardware devices are reset. See Control the end of tracking

▪When the Rule End box of the Start/Stop trial rule is evaluated, data recording stops. From that moment, Trial Control is deactivated, even in those sub-rules that were ongoing in the meantime.

Schematic representation of how Trail Control Instructions are executed. The scheme shows an example of a Start-Stop trial rule.

1.Tracking starts, either manually or because a previous condition has been met.

2.Control passes to a Condition box (for example, “Is mouse on top of Shelter?” which becomes active (hatched outline). The condition is evaluated. Since the condition is not met immediately, it becomes false.

3.The Condition becomes true (solid outline).

4.Control passes to the next box. In this case, it is an Action. Actions are taken immediately.

5.The Action box becomes inactive (light outline). The next box becomes active.

For clarity, step 3 and 4 have been placed separately. In reality, when a condition is met it becomes inactive at the same time, and control passes to the next box.