Now Shipping! – The EyeLink 3; combined head and eye tracking at up to 1000 Hz.

FAQ: How can I take advantage of the timing offset in sending messages?
#1
Given various limitations of other stimulus presentation software, it is sometimes necessary to write messages to the EDF that relate to an event that has already transpired, or that will be occurring at some point in the future. If this relative timing offset between sending the message and the actual event timing is known, it is possible to specify a temporal offset so that Data Viewer interprets the message as occuring at the actual time of the event, and not when the message itself was written to the EDF.

For example:

Assume a trial starts at t = 0 ms, a particular stimulus display was shown at t = 500 ms, and the trial run finished at t = 1250 ms. It is important to send a message to the EDF that marks the onset of the stimulus display, so that the correct Interest Period can be set in Data Viewer.

In EPrime, for example, it is not possible to send messages to the EDF at the exact time the image is drawn to the screen. Instead, we must send messages near the end of the trial (at or after t = 1250 ms) that retrospectively demarcate the instant at t = 500 ms when the stimulus was shown (or the timing of any other event).

To do this, when the trial task has been completed but recording is still going, we can get the current time and assign it to a variable, let's call it
  • timeEnd = 1250
If we know that in fact our stimulus was shown at t = 500 ms (in EPrime, this is retrieved with the imageSlide.OnsetTime function, imageSlide being whatever display stimulus you are working with), then we can compute the relative timing offset from the timeEnd variable:
  • timingOffset = timeEnd - imageOnset
  • timingOffset = 1250 - 500
  • timingOffset = 750
Next we send a message to the EDF file that relays both the timingOffset value along with our actual imageOnsetTime text (i.e. "750 imageOnsetTime"). The following message will appear in the EDF File:

Code:
MSG 1250 750 imageOnsetTime

Data Viewer subtracts the second value (the offset) from the first (the time at which the message was written), and assigns the message to the correct time of the stimulus onset within the trial (1250 - 750 = 500). Negative offset values are also subtracted in this way, and can therefore be used to signal events that happen after the message is written.