Settings for using E-Prime in the Waisman fMRI
Lab.
Using the
TTL from the scanner to trigger the start of an experiment
To
automatically start your Eprime experiment in-synch with the start of fMRI
acquisition, you need to set up a Port object (in the Experiment object at the
top of the experiment structure) with the address &H28a – call this Port1.
Then set up a blank screen right before the start of the experiment and enable
response input through Port1. Set the duration of the blank screen to ‘infinite’,
set the response to the same duration, and set the response action to ‘terminate’.
It’s a good idea to have a mouse response set up in the same way so that if
something goes wrong with the TTL port, you can trigger the experiment with a
mouse click.
Sending
event marker codes to the skin conductance acquisition PC
Event
codes can be sent to the skin conductance acquisition PC through port &H278
(a parallel port). Codes can be any integer from 0-255. Usually it’s a good
idea to send a code right before the onset of an event/stimulus/trial, and then
following that event/stimulus/trial send 0 to the port. This is done using an
inline script and the writeport command. E.g.:
writeport &H278,2
Starting and
stopping eye tracking from Eprime
Eye
tracking can be started and stopped by sending the appropriate command strings
to the serial port COM2. To start, you need to set up a Serial Port object (in
the Experiment object at the top of the experiment structure) with the port
COM2 – call this Serial2. Bits per second should be set to 9600, with 8 data
bits, 1 stop bit, and Parity set to none. Then use inline scripts to send text
strings through this port. The complete set of possible commands in available
in the SMI manual (available from Michael Anderle or Rom Fisher by request).
Here are some examples:
To
clear the eye tracking buffer:
serial2.FlushOutBuffer
strData
= "ET_CLR" & Chr(10)
Serial2.WriteString
strData
To
start eye tracking:
strData
= "ET_REC" & Chr(10)
Serial2.WriteString
strData
To stop eye tracking:
strData
= "ET_STP" & Chr(10)
Serial2.WriteString
strData
To save eyetracking data in a file with a subject, session, and
scan run-dependent filename:
runNum
= runNum + 1
fileName
= str(c.GetAttrib("Subject")) & "_" &
str(c.GetAttrib("Session")) & "_" & str(runNum)
& ".DAT"
strData
= "ET_SAV C:\\DATA\\MYSTUDY\\" & fileName & Chr(13)
Serial2.WriteString
strData