SR Research Support Site
EyeLink Programming Conventions

The EyeLink Developers Kit library contains a set of functions used to program experiments on a variety of platforms, such as Windows, Linux, and macOS. Some programming standards, such as placement of messages in the EDF file by your experiment, and the use of special data types, have been implemented to allow portability of the development kit across platforms.

Standard Messages

Experiments should place certain messages into the EDF file, to mark the start and end of trials. These messages will facilitate the SR Research viewing and analysis applications (e.g., Data Viewer) to process the EDF files.

Text messages can be sent to the EyeLink Host PC and added to the EDF file along with the eye movement data. These messages will be time stamped with an accuracy of 1 millisecond from the time sent, and can be used to mark important events such as display changes. Be careful not to send messages too quickly: the eye tracker can handle about 20 messages every 10 milliseconds. Above this rate, some messages may be lost before being written to the EDF file.

To facilitate data analysis in EyeLink Data Viewer, special messages can be added to the EDF file. Examples of these messages include those that specify the overlay image, the interest areas, and the trial variables. Detailed information about the various standard messages that Data Viewer recognizes can be found in the "EyeLink Data Viewer User Manual" (https://www.sr-support.com/thread-135.html).

Trial Return Codes

The recording support functions in the eyelink_core library return several standard error codes. Your trials should return these codes as well, so that sequencing can be controlled by the return code. An example of this sequencing is given in trials.c of the Simple template.

Return CodeMessageCaused by
TRIAL_OK"TRIAL OK"Trial recorded successfully
TRIAL_ERROR"TRIAL ERROR"Error: could not record trial
ABORT_EXPT"EXPERIMENT ABORTED"Experiment aborted from EyeLink Abort menu or because link disconnected
SKIP_TRIAL"TRIAL SKIPPED"Trial terminated from EyeLink Abort menu
REPEAT_TRIAL"TRIAL REPEATED"Trial terminated from EyeLink Abort menu: repeat requested

The REPEAT_TRIAL function cannot always be implemented, because of randomization requirements or the experimental design. In this case, it should be treated like SKIP_TRIAL.


Copyright ©2002-2021, SR Research Ltd.