Summary: Response Collection/Devices
Sarah Callahan
langdev at yahoo.com
Thu Jan 23 17:46:34 UTC 2003
Hello all,
It was suggested that I post a summary of the
responses I received to my earlier question about
response collection in-scanner and enabling devices.
Two people were kind enough to send me code snippets
that they were successfully using. My thanks to them.
Note that my situation was further complicated by the
implementation of my paradigm through the IFIS system.
Not everyone may have this problem.
If you would like Stephen Johnston's code, please
email me and I will be happy to send you the
attachment.
Best regards,
Sarah Callahan
1.
'<***** COPY BELOW TO USER SCRIPT SO IT IS AVAILABLE
GLOBALLY****>
' Constants for the BSOFT DIG130/24 card
Const DIG130_BASE As Integer = &H200
Const DIG130_PORT_A As Integer = DIG130_BASE + 28
Const DIG130_PORT_B As Integer = DIG130_BASE + 29
Const DIG130_PORT_C As Integer = DIG130_BASE + 30
Const DIG130_PORT_CONTROL As Integer = DIG130_BASE +
31
' DIG130 Control port assignments for Mode 0
' 7 6 5 4 3 2 1 0
' 1 0 0 x x 0 x x
' | | | |___ Port2(C) (lower 4 bits) 0=output,
1=input
' | | |_____ Port1(B) (all 8 bits) 0=output,
1=input
' | |
' | |_________ Port2(C) (upper 4 bits) 0=output,
1=input
' |___________ Port0(A) (all 8 bits) 0=output,
1=input
'
' DIG130 Initialize
' Port0(A) - input, Port1(B) - input, Port2(C) -
output
' 7 6 5 4 3 2 1 0
' 1 0 0 1 0 0 1 0 = &H92 -> A-in, B-in, C-out
Const DIG130_CONFIG_DATA As Integer = &H92
' Constants for BRU configuration
Const BRU_RIGHT_ONLY = 1 ' RH 1-5
Const BRU_LEFT_ONLY = 2 ' LH 1-5
Const BRU_RIGHT_LEFT_UNIQUE = 3 ' RH 1-5, LH
6-9,A
Const BRU_RIGHT_LEFT_DUPLICATE = 4 ' RH 1-5,
LH 1-5
Dim g_BRU As BRU
'<***** COPY ABOVE TO USER SCRIPT SO IT IS
AVAILABLE
GLOBALLY****>
'<***** COPY BELOW TO AN INLINE AT THE BEGINNING
OF THE
PARADIGM****>
Set g_BRU = New BRU
g_BRU.Address = DIG130_BASE
g_BRU.Configuration = BRU_RIGHT_LEFT_UNIQUE
g_BRU.Reset DIG130_CONFIG_DATA
g_BRU.Enable
'<***** COPY ABOVE TO AN INLINE AT THE BEGINNING
OF THE
PARADIGM****>
Once the above script is executed any responses
on the BRUs will
be posted to the keyboard device when the script is
running on the IFIS
equipment (e.g. a machine that has a BSOFT DIG130 card
installed in it
and has the IFIS MCU connected to the DIG card). You
just code your
experiment to use the keyboard device for input and
the BRU object
(once
enabled) will make sure that responses get posted to
the keyboard
device.
Note the comments in the code for the different
mapping/configuration options, e.g. depending on the
needs of the
experiment you can change the mapping of the button
IDs or disable one
or the other hand as necessary.
> I have a few
> questions:
>
> 1)You mentioned that we need IFIS hardware for
I/O. Does
> this mean that
> the experiment must run on the control/analysis
(aka bottom)
computer
> and not the patient/top computer? In that
case, can the
Netstation
> package calls that will have to be included
also work from
there?
The solution above only works when you are
running the
experiment on the EPC installed in an IFIS Console (as
opposed to an
arbitrary desktop PC just running E-Prime). The
experiment goes on
the
EPC (aka top) because it is the machine that has the
DIG130 card
installed in it. For this setup however you do not
need to run the
experiment via the IFIS System Manager (which runs on
the CAC aka
bottom
computer).
Thus, if you stick the above code in ANY E-Prime
experiment AND
you are running the experiment on the IFIS hardware
(which has the BRUs
connected to it) then you should be able get inputs
from the BRU. If
you attempt to run this on an arbitrary desktop
machine with E-Prime
you
will either get no responses issued through the BRU
device OR arbitrary
responses may come sporatically, e.g. since there
would be no card at
the port address being examined there is the potential
that the bit
states could 'float'. On most machines that I have
done this on it's
not a problem.
2. Here is a piece of code that worked for us,
connecting a hand device to
a scanner. The problem you mention I think is that, in
our case, we had
to create the target stimulus in the inline script and
manipulate it
via
e-prime code, so we had to determine in the script
whether the answer
was right or not and set Target.ACC ourselves.
Sorry about the way the code looks - it was the first
bit of e-prime
code we had written so all that Target attribute stuff
at the beggining
is unnecessary. The switches themselves were connected
as a serial
device.
Hope this helps in some way.
Steve
=====
Sarah Callahan
Neuroscience Research Coordinator
FMRI Research Center
Columbia University
212-342-0299 (main)
212-342-9016 (direct)
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
More information about the Eprime
mailing list