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
Some stimulus presentation software (like E-Prime) cannot send a message to the EDF file at the exact moment a stimulus appears. The message must be sent later, after the event has already happened. This creates a timing mismatch between when the event occurred and when it was logged.

Offset Message Format
Data Viewer can correct this mismatch by interpreting a specially formatted offset message. When you send a message, you can include a temporal offset that tells Data Viewer when the event actually occurred relative to when the message was sent. Data Viewer will treat any message that begins with an integer value as an offset. The format is:
Quote:MSG [Time_Message_Was_Sent] [Offset] [Message_Text]

When Data Viewer reads this, it calculates the true event time using the formula: True_Event_Time = Time_Message_Was_Sent - Offset.

Step-by-Step Example (Retrospective Timing)
Let's say a stimulus appears at 500 ms, but we can only send the message at the end of the trial, at 1250 ms.
  • Get the known event time:
    Code:
    imageOnset = 500
  • Get the current time (when you're sending the message):
    Code:
    timeEnd = 1250
  • Calculate the offset (e.g. 1250 - 500 = 750):
    Code:
    offset = timeEnd - imageOnset
  • Send the formatted message:
    Code:
    tracker.sendMessage "750 imageOnsetTime"
    Note: The exact implementation of sending the message will vary depending on the programming language. The example above illustrate sending messages via E-Prime's syntax.

The message logged in the EDF file will be similar to the following:
Quote:MSG 1250 750 imageOnsetTime

Data Viewer will detect that the message begins with an integer and subtract the offset from the time the message was received so that the imageOnsetTime marker is shifted to 500 ms (1250 - 750).

Note: You can also use a negative offset to mark an event that will happen in the future relative to when the message is sent. The same subtraction (Time - (-Offset) = Time + Offset) applies.