SignalData - Meg Wiki

Revision 5 as of 2011-01-18 12:15:28

Clear message
location: SignalData

Using E-Prime's Onset Signal mechanism

Much has been written on the topic of accurate timing using E-Prime. See also the dedicated page on ["Using E-Prime"]. There are several ways to send a trigger signal from the stimulation (STIM) computer to the MEG acquisition computer, but some of these will produce unpredictable timing errors under certain circumstances (e.g., using inline code & pre-release time together). I strongly recommend [http://www.pstnet.com/e-prime/support/kb.asp?TopicID=1318 this page] on the E-Prime support site.

Timing seems to work well with the 'OnsetSignalEnabled' method. The basic strategy is to insert inline code at the beginning of the experiment telling E-Prime to send a trigger every time it presents a certain object or objects (e.g., 'Target' and 'Blank'). This ensures that the trigger is time-locked to the presentation of the stimulus. [Note that this time-locking is NOT guaranteed if you simply insert an inline 'writeport' command ahead of the object if you are using pre-release time and vertical refresh syncing!] You will generally want to reset the port to 0 by enabling OnsetSignal on the following object with a value of '0', by setting an OffsetSignal with value '0' or by inserting inline code with 'writeport' and value 0 after the object. If you want the trigger value to vary with stimulus condition, you can accomplish this using inline code at the beginning of the trial.

There's also an equivalent OffsetData command that will allow a trigger to be send when the object terminates. This can be used to send 0 to the parallel port, preparing the port for the next trigger. Used in this way the duration of your triggers will be the same as the duration of the actual stimulus presentation. Be careful when using pre-release, though, as we've found that this will make the object send the Offset trigger at pre-release time and not at the actual offset of the object.

Here's an example. Imagine a simple trial structure with a DisplayTarget text object followed by a DisplayBlank text object. We want to send a trigger from STIM to MEG whenever DisplayTarget is presented, and we want the trigger value to reflect the stimulus condition.

At the beginning of the session procedure, insert an inline object containing:

'Enable port signal (value 1 for now) for DisplayTarget:
DisplayTarget.OnsetSignalEnabled = True
DisplayTarget.OnsetSignalPort = &H378
DisplayTarget.OnsetSignalData = 1

'Enable port signal (value 0) for DisplayBlank:
DisplayBlank.OnsetSignalEnabled = True
DisplayBlank.OnsetSignalPort = &H378
DisplayBlank.OnsetSignalData = 0 

At the beginning of the trial procedure, insert an inline object containing:

'Set DisplayTarget port signal value based on condition:
DisplayTarget.OnsetSignalData = c.getattrib("ConditionCode") 

Where 'ConditionCode' is a numeric variable in the range (1:255). This variable can be defined as a column in your List or using inline code.