menu_book

Knowledge Base

Documentation, guides, and resources for Noldus products.

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

Last updated: Jul 30, 2026

Program Trial Control

Example 3 - Play a Sound at Trial 3

This example assumes that the researcher acquires a batch of trials live, and wants to present an acoustic stimulus during trial 3.

The batch file looks like as follows:

@echo off
echo %1
IF %1=="Trial     3" (
start wmplayer D:\Temp\Stimulus_sound.wav
)
timeout /t 5 /nobreak > NUL

Next, in the Trial Control settings, create an External command, specify the batch file and in the Command line options enter "%tn%".

Note:

  • The line echo %1 reads the first parameter; in this case, the trial name.
  • In the IF line, there must be five spaces between Trial and the number 3. Reduce by one space if the trial number has more digits: 4 spaces for Trial 10–99, three spaces for Trial 100–999, etc.
  • To make sure that you enter the correct number of spaces in the Trial name, copy the name of the trial from the Trial list (Setup menu > Trial List, then click Show/Hide > Variables and choose Trial Name). Copy the content of the cell in the Trial name column for that trial, and paste the trial name in the batch file.

Operators

Aim

The Operators help you combine actions, conditions and sub-rules in various ways.

Examples

  • When at least one of the two conditions A and B is met, then do … . This is an example of conditions combined by an operator of the Any type (OR logic).
  • When two conditions are met at the same time, then do … . This is an example of conditions combined by an operator of the All type (AND logic).
  • When at least/at most/exactly 4 of 8 conditions are met, then do … . This is an example of conditions combined by an operator of the N of All type.

Procedure

  1. Define the conditions, actions, and rules that you want to combine. Place them in your Trial Control sequence as parallel branches, as shown in the figure below.
  2. In the Components pane, under Structures, double-click Operator or click the button next to it.
  3. If the Add an Operator window appears, it means that there is at least one operator of the same type in your experiment. You are asked to choose between creating a new operator, or re-using an existing one. If this window does not appear, skip this step.
    • Create a new operator: A new operator is created.
    • Re-use an existing operator: Select the name of the operator already present in your experiment.
    Click OK. The Operator window appears.
  4. Under Name, enter the Operator name or accept the default name Operator (n), where n is a progressive number.
  5. Under Operator Triggers When, select the option that applies:
    • Any (at least one) of the inputs is 'true'.
    • All inputs are simultaneously 'true'.
    • N of All inputs are simultaneously 'true'.

    Where 'true' means a condition met, an action carried out, or a sub-rule finished (depending on the elements you want to combine).

    If you choose the third option, specify how many inputs must be 'true': = (exactly equal to), not= (not equal to), >= (at least), <= (a maximum of), etc. Specify the number in the box.

  6. Enter a Comment (optional) to describe this operator, and click OK.
  7. A new Operator box appears in the Trial Control. Place the box to the right of the elements defined in step 1, and connect each element to the operator box.
  8. Connect the operator to the next element in the Trial Control sequence.

Notes

  • Names of operators must be unique in your experiment. You cannot define two operators with the same Operator name, even if these are defined in two different Trial Control Settings.
  • An Operator can also have just one input box. In that case the operator is of no use, because control passes immediately to the next box as soon as the input condition becomes true or the input action is carried out. EthoVision informs you about this.
  • Operators can also combine sequences of elements. For example:
    • Sequence 1: When the animal presses a lever (Condition), then drop a food item (Action).
    • Sequence 2: Time = 5 minutes (Condition; this equals to waiting 5 minutes).

    If you want the program to take an action when either sequence has been completed, combine the two sequences with an Any operator.

Re-Use Trial Control Elements

The elements of Trial Control (conditions, actions, operators, sub-rules and sub-rule references) that you have defined in other Trial Control Settings can be duplicated and re-used in the current Trial Control Settings to reduce your time spent editing.

To re-use all the elements defined in your current Trial Control Settings profile, make a copy of it: right-click the profile in the Experiment Explorer and select Duplicate.

To Re-Use a Trial Control Element

  1. Click the button next to the category of element that you want to re-use.
  2. The Add window appears. Select Reuse an existing condition / action / sub-rule / reference.

    This window does not appear when the experiment contains only one Trial Control Settings profile, or the experiment contains more Trial Control Settings profiles but none of them contains an element of the same type as that you have chosen.

  3. Select the name of the existing element from the list next to the option.

    The second list shows the Trial Control Settings profile that contains that element. If the element is present in multiple Trial Control Settings, choose the appropriate one from the list.

  4. Click OK.
  5. A window appears for the type of element chosen. The Name and settings specified here are the same as in the element chosen in step 3.
    • To create an identical copy of the element, click OK and go to step 7.
    • In all other cases, edit the settings and click OK, then go to step 6.
  6. If you have changed any property of the new element (including name and comment), a window appears showing two options:
    • Apply the new settings only in the current Trial Control profile.
    • Apply the new settings in all writable Trial Control profiles.

    Choose whether you want to apply the properties only to the new copy, or to extend those changes to the original elements in all Trial Control Settings that are writable (that means, not locked after acquisition). Choose the option you require and click OK.

  7. Insert the resulting box in the Trial Control sequence.

Notes

  • If you choose the option Apply the new settings in all writable Trial Control profiles, changes are not made in those profiles made read-only after data acquisition.

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

Request a trial license

Try the software in your own lab before you buy. We offer trial periods for qualifying researchers.

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.