Some stimulus presentation software (e.g., E-Prime) cannot send a message to the EDF file at the precise moment a stimulus appears. Instead, the message is sent retrospectively after the event has occurred, creating a timestamp mismatch.
Offset Message Format
Data Viewer can correct this mismatch by interpreting a specially formatted offset message. If a message begins with an integer, Data Viewer treats that integer as a temporal offset (in milliseconds) representing the delay between the event and the message command. The syntax of message events are as follows:
When Data Viewer reads this and detects an offset is present, it calculates the true event time using the formula: True_Event_Time = Time_Message_Was_Sent - Offset.
Step-by-Step Example (Retrospective Timing)
Consider a scenario where a stimulus appears at 500 ms, but the software can only send the message at the end of the trial, at 1250 ms.
Data Viewer Interpretation:
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 logic remains the same:
Offset Message Format
Data Viewer can correct this mismatch by interpreting a specially formatted offset message. If a message begins with an integer, Data Viewer treats that integer as a temporal offset (in milliseconds) representing the delay between the event and the message command. The syntax of message events are as follows:
When Data Viewer reads this and detects an offset is present, it calculates the true event time using the formula: True_Event_Time = Time_Message_Was_Sent - Offset.
Step-by-Step Example (Retrospective Timing)
Consider a scenario where a stimulus appears at 500 ms, but the software 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:
Note: The syntax above is an example (similar to E-Prime). The exact implementation depends on your programming language.Code:tracker.sendMessage "750 imageOnsetTime"
Data Viewer Interpretation:
- Data Viewer reads the message timestamp (1250).
- It detects the leading integer (750) as the offset.
- It performs the subtraction: $1250 - 750 = 500.
- The imageOnsetTime marker is placed at 500 ms in the viewer.
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 logic remains the same:

