EthoVision XT 19 - Trial Control Settings - External Commands
Last updated: Jul 28, 2026
External Commands
Aim
To trigger external software with EthoVision XT.
Prerequisites
- You need at least the Base version of EthoVision XT.
Procedure
- Open or create new Trial Control Settings.
- In the Components pane, under Actions, click the button next to External Command.
- Next to Action Name, enter the name of the action (for example, start recording) or accept the default name.
- Under Actions to Perform, select which file you want to run by clicking the ellipsis button.
- Select one of the file types from the list: Executables (*.exe) or Batch Files (*.bat, *.cmd).
- Browse to the file and click Open.
- Optionally, enter a Command Line option. Click the Information button to get additional information about defining an External Command. For more details, see the EthoVision XT 19 - Trial and Hardware Control - Reference Manual.
- To test the command, click the Test button.
Note
If you work with two or more arenas, be aware that an external command is sent out for each arena. For example, the command to play a sound is repeated 96 times for a 96-well plate DanioVision experiment. To prevent this from happening, put a condition before the External Command box that will only become true for one of the arenas, for example Arena 1. In the Arena Settings, create a zone in Arena 1 and call it "Zone 1A". Make the zone as large as the arena. In the Trial Control Settings, make a condition like "Is subject in Zone A?", followed by the external command. Make sure that the sequence does not interfere with the rest of the Trial Control rule.
Application Examples
- Play a sound
- Trigger video recording with MediaRecorder
- Trigger sound recording with UltraVox XT
Play a Sound
Aim
To play a sound file while carrying out a trial.
Procedure
- Open the Windows Notepad and enter the following text, replacing the text within quotes with the actual path to your sound file:
@echo off
set soundFile="D:\Sound Files\Stimulus1.wav"
start "" "C:\Program Files\Windows Media Player\wmplayer.exe" %soundFile% - Save the file with the *.bat extension.
- Follow the procedure in External Commands to create an External Command action that selects the batch file.
- Place the External Command box in the Trial Control rule.
Notes
- Create one batch file for each sound file you want to play during the trial. Create multiple External Command actions, one for each batch file, and place them in the Trial Control rule.
- wmplayer represents Windows Media Player. You can also use other software to play audio, for example VLC:
@echo off
set soundFile="D:\Sound files\Stimulus1.wav"
start "" "C:\Program Files\VideoLAN\VLC\vlc.exe" --play-and-exit %soundFile% - For examples of Command Line options, see External Commands in the EthoVision XT 19 - Trial and Hardware Control - Reference Manual.
See Also
- External Commands
Trigger Video Recording with MediaRecorder
Aim
To record high resolution video with MediaRecorder while tracking subjects with EthoVision XT.
Prerequisites
- You work with analog video cameras. If you work with digital cameras, EthoVision XT and MediaRecorder cannot access the signal from a digital camera simultaneously.
Procedure
- In the Trial Control Settings, create a condition that must be true in order to trigger video recording.
- Follow the procedure in External Commands to create an External Command action that starts video recording in MediaRecorder. To visualize batch (*.bat) files, choose Batch Files (*.bat; *.cmd) next to File Name.
- Place the second box after the first in the Trial Control rule.
Example 1
In this example, the trial starts in the early afternoon but the researcher wants to start video recording only after 6 PM (18:00) and end it after 12 hours. The box sequence is as follows:
- Start Tracking.
- Open MediaRecorder. Add the Command Line option /E.
- Wait until 18:00.
- Start video recording. Add the Command Line option /R.
- Wait 12 more hours.
- Stop video recording. Add the Command Line option /S.
Example 2
In this example, the researcher carries out live tracking during a 24-hour period. The trial starts during the light cycle when the animal is inside the shelter, but the researcher wants to start recording video only when the animal leaves the shelter. This saves significant disk space as the resulting video will be shorter.
- Create an External Command action to open MediaRecorder. Select MRCmd.exe as the program to run and enter /E as a Command Line option.
- Create an In Zone condition "Out of Shelter".
- Create a Time condition to make sure that video recording starts when MediaRecorder is already open on the screen. Combine the two condition boxes with an operator of type All Inputs True.
- Create an External Command similar to the first one, this time with /R as a Command Line option to start recording.