menu_book

Knowledge Base

Documentation, guides, and resources for Noldus products.

EthoVision XT 18 - THC - Trial and Hardware Control - Sub-Rules (Continued)

Last updated: Jul 30, 2026

Sub-rules (Continued)

If your variable is of the type true/false, and switches between true and false several times, the sub-rule starts only the first time that the variable gets the value required since the activation of the Reference. For more information on Trial Control variables, see page 28.

Sub-rule Stop Conditions

  • Execute sub-rule once per start condition (default): The sub-rule is executed once when one of the Start conditions is met.
  • Repeat indefinitely (no scheduled stop): The sub-rule is repeated until the trial stops (see page 69 for how this can happen).
  • Repeat per start condition: The sub-rule is repeated a number of times, or until a condition is met.
    • For a number of times. To have the sub-rule repeated a fixed number of times for that start condition. Enter this number in the box (default = 2).
    • For a duration of (hh:mm:ss). To have the sub-rule repeated for a specific time period beginning from the corresponding start condition. Enter this time in the box. The maximum time allowed is 99 h 59 min 59 sec. Choose this option if you want a task to be repeated for some time, no matter how many times in that period. If you choose this option, when the time elapsed since the start condition exceeds the time set here, the ongoing repeat will continue till its end, but no new repeat will start.
    • Until Trial Control variable. To have the sub-rule repeated until a Trial Control variable (see page 28) gets a certain value. Click Edit, specify the variable, its value and click OK. For example, repeat the sub-rule until the variable Count reaches 100. Specify Count <= 100.

If you select two or more Repeat per start condition options, no more new repeats are started as soon as any of the conditions is fulfilled.

A sub-rule is completed when the last repeat for the planned Start condition is ended. See also the note on Endless loops on page 65.

Options for Starting a New Repeat

  • Do not start new repeat when there is still a repeat ongoing. A new repeat is not started. A new repeat will start at the planned time, after the ongoing repeat has been completed.
  • Delay new repeat till ongoing repeat finishes. The repeat starts as soon as the ongoing repeat finishes.
  • Terminate ongoing repeat and start new one. The ongoing repeat is ended no matter at which point it is, and a new repeat is started.

Example: A sub-rule is planned to start every 10 minutes. The first Start condition is set to 12:00 h, the second to 12:20 h etc. Suppose that at 12:10, a repeat has not been completed yet, and it will be completed at 12:15.

  • When selecting the first option above, the repeat planned at 12:10 is not started. The program will start the next planned repeat, at 12:20, provided that the first repeat has been completed.
  • When selecting the second option, the repeat of 12:10 starts at 12:15 when the first repeat has been completed.
  • When selecting the third option, the repeat of 12:10 starts at the planned time. The repeat of 12:00 is forcibly terminated.

If Trial Control switches on a light or sound device at the time the repeat is aborted, that device stays on until a switch off command is encountered in the next repeat (or another ongoing sub-rule).

Place the Sub-rule Reference in the Trial Control Sequence

The position of the sub-rule's Reference box influences progress in the Trial Control sequence. Consider the difference between the following two cases:

  • Reference box in the linear sequence. Control can only progress when the Reference box becomes inactive. This occurs when the last repeat of the sub-rule has been completed.
  • Reference box on a dead branch of the sequence. When the sub-rule's Reference box becomes active, the box placed in parallel becomes active too. Thus, control moves forward independent of whether the sub-rule has been completed.

For more information on activation of Trial Control boxes, see page 10.

End a Sub-rule

A sub-rule is normally ended when the last repeat (see page 63) is completed. However, it can also be forcibly interrupted in the following cases:

  • When the maximum trial duration has been reached.
  • When you stop the trial manually.
  • When a condition passes control to the next box in the sequence. When the Condition is met, the Any operator applies the OR logic, and passes control to the next box. The sub-rule is interrupted.
  • When the Reference box is placed on a dead end of the Trial Control sequence. Depending on the instructions specified in the Start-Stop Trial rule, the trial may stop before the last repeat of the sub-rule is completed.

When the last repeat of the sub-rule is ended, the corresponding Reference box becomes inactive. See also the note about Endless loops on page 65.

Call a Sub-rule from Another Sub-rule

Within a sub-rule, you can define a reference that calls another sub-rule.

Why insert a sub-rule within another sub-rule? Suppose that your Trial Control is made of four sub-rules that have at least some instructions in common. For example, sub-rules that start at different times, but include the instructions to have the program make a light flash. In such a case, you can define the instructions for the light flash in a separate sub-rule, and then in each of the four sub-rules insert a reference to this sub-rule.

  1. Define the sub-rule that should contain the reference to another sub-rule (see page 61).
  2. Define the sub-rule that should be called by the first one, and its own reference (see page 63).
  3. Insert the Reference box of the second sub-rule in the sequence of the first sub-rule.

Example of Calling a Sub-rule from Another Sub-rule

Sub-rule 1 counts the number of times the animal enters the shelter via a particular route. When the animal does so (Condition A), a Reference box (B) calls Sub-rule 2.

Source: EthoVision XT 18 - THC - Trial and Hardware Control, Noldus Information Technology

Interested in this solution?

Leave your details and we will reach out to discuss how we can support your research goals.

Noldus is here to assist you throughout the whole process.

shopping_bag
check_circle

Thank you!

We'll get back to you shortly.

error

Please correct the following errors:

error

error

error

error

By clicking Submit, you consent to Noldus processing your data as described in our privacy policy.