The first part of the script (seen above) details the following instructions for the unit which are applicable throughout the experiment:

Include zsys - this must be included in all scripts.

The next group of commands - SET - are the settings for the tracking of the particular model organism that you are studying.

The DEFINE and SETLIGHT commands define the shape, positions and sizes of the lights that will appear on the screen.

The LOAD commands load the detector zones as set out in the bitmap which must be saved in exactly the same style (upper and lower case) in the Assets directory: test_2arenas2w.bmp. The same applies for the arenas, which details the shape and orientation of the different arenas for the fish.

The DEFINE commands following detail the number of seconds to wait when instructed in the script below.

Action Main

This next set of commands (above) details the order of the whole experiment. In this case:

First the lights are all turned off.

Next an auto reference is taken of the tank. After this point the unit starts tracking the movement of the model organisms, monitoring changes in x and y coordinates and keeping a tally of distance travelled, time spent in different detector zones, time spent in arena, number of visits to detector zones.

The first part of the experimented is invoked, HABITUATION, once. The details of the HABITUATION period will be detailed in its own ACTION section below.

The next part of the experiment is invoked, BASELINE, once. The details of this period will be detailed below similarly.

LIGHT1 will come on as colour blue - the position of LIGHT1 was detailed in the first section of the zanscript.

LIGHT2 will come on as colour green at the same time - again its position has already been detailed.

The unit will then wait for the UNIT_TIME (as defined earlier) before LIGHT1 illuminates as green and LIGHT2 as blue. These light settings on the screen will wait for the unit time before turning off. The unit then waits for the PROBE_TIME, as set out above, before this action is complete.

Action Baseline

This is a fairly long section of code so I have broken the ACTION BASELINE into a couple of sections to explain it.

The first command tells the unit to record a video of the experiment for 60 seconds, which will be saved in the media directory as a video file called baseline.avi

The next commands are then very similar to subsequent parts of the ACTION BASELINE commands, instructing the unit to change the screen lights and record the organism's tracking data at 10-second intervals:

The two lights are set as blue and green and positioned on the screen

The unit takes a snapshot of the data at this moment

After waiting (for 10 seconds, the defined WAIT_TIME) the unit takes another snapshot of the data. It then extracts the differences between the two snapshots, following the DATA_SELECT and DATA_DELTA commands.

The LOGCREATE, and subsequent LOGAPPEND, lines detail the labels for the cell data to be included in the results file. N.b. each line of code can be a maximum of 78 characters, if you have a longer line of code you need to use the LOGAPPEND command to run it over a new line. The LOGCREATE command for each cell is written sequentially and separated with a line | , these include:

RUNTIME - which details the exact time this line of data was recorded.

TEXT: - the space after the colon indicates that this cell is left empty.

TEXT:BASELINE - any word written after the colon is written in the cell, in this instance 'BASELINE' is written in the cell.

LOGRUN instructs the unit to output all the previous LOGCREATE commands.

The INVOKE(WRITEDATA) command then tells the unit to carry out the ACTION WRITEDATA (which is detailed below).

The last set of commands in this ACTION tell the unit to record the tracking data for the whole 60 second period.

In the above code the commands to the unit are similar to the first group of commands at the top of ACTION BASELINE. These groups of commands are repeated at 10 second intervals, collating results data for each 10 second period.

Script download

Here you can download the results data demo script as a .zs file. Right click on the download link below and download / save the file as a zanscript file, i.e. in the same format: data_demo.zs . You will also need to save the assets (used in the script) into the unit's Asset directory. Make sure that the name of the assets exactly matches the name you use in the script (upper and lower case).

Run the demo service

Build as a service - Once written, the zanscript is built (.zex file) and loaded on the Settings page in one of the 20 slots a service.

Run the demo service - The experiment can now be operated from the home page. In the following video example the demo script was run with 2 fake fish.

Baseline video

The 'Baseline' video, recorded during a test run, shows how two fake fish were moved during the Results data demo service. You will see that both fish moved from zone to zone together, but each time the colour stimuli changed Fish 2 moved more than Fish 1 in one of the zones.

Results data file

The image below illustrates how the results data file details how the data was collected in 10 second periods for each fish: the distance travelled in each zone; time spent in each zone; a count of number of times each zone is entered.

You may download the full results data file as a .csv file by clicking on the link here.

A snapshot of the results data illustrating the data captured during one 10 second period.

Script variation

The data demo script described above was for 2 arenas, with 2 fake fish. The demo script below, data_demo_1_fish.zs, has been altered so that it is for just one fake fish, swimming over two zones. If you download the script you will see that the auto reference has been modified to 0 - SET(AUTOREF_MODE,0); and in the LOGCREATE (and subsequent LOGAPPEND) lines all references to Arena1 and Arena2 have been deleted.