Sending triggers for targets and responses from E-prime

655 views
Skip to first unread message

berserker-ulf

unread,
Apr 22, 2008, 8:37:51 AM4/22/08
to E-Prime
Hi!

I’m new to E-prime, and I hope somebody can help me with this problem:
I tried to run an experiment where three different tones are used as
targets. Every time a tone is emitted, I want E-prime to send a
trigger to another computer. I used the following script, but it only
sends a trigger the first time the tone appears and not in the
following instances:

Dim someCode as integer
someCode = CInt (c.GetAttrib ("triggercode"))
Ton.OnsetSignalEnabled = True
Ton.OnsetSignalPort = &H378
Ton.OnsetSignalData = someCode
Ton.OffsetSignalEnabled = True
Ton.OffsetSignalPort = &H378
Ton.OffsetSignalData = someCode

My second question: How can I send triggers for responses (in this
experiment it’s mouse button clicks)?

Thanks!

David McFarlane

unread,
Apr 22, 2008, 9:56:03 AM4/22/08
to e-p...@googlegroups.com
I have never used the onset & offset signals, but I will hazard a
guess that your offset signal must be different from your onset
signal, otherwise the signal never changes once it is set. Here is
an example change in your code:

Dim trigOnCode as integer
Dim trigOffCode as integer
trigOnCode = CInt (c.GetAttrib ("TriggerOnCode"))
trigOffCode = CInt (c.GetAttrib ("triggerOffCode"))


Ton.OnsetSignalEnabled = True
Ton.OnsetSignalPort = &H378

Ton.OnsetSignalData = trigOnCode


Ton.OffsetSignalEnabled = True
Ton.OffsetSignalPort = &H378

Ton.OffsetSignalData = trigOffCode

-- David McFarlane, Professional Faultfinder

Raúl Oyuela Vargas

unread,
Apr 22, 2008, 5:24:05 PM4/22/08
to e-p...@googlegroups.com

Hi everybody:

I have a problem with the serial box response and I hope you can help me.

First of all, the SRBOX doesn't have a USB cable... Nowadays all computers
onlu use USB.... So, for the SRBOX I had to buy an USB/Serial conversor.
Don't you have this cable available for news computers?

Another problem is, the SRBOX is not responding. I don´t know if the problem
is in the USB/Serial Conversor. The error message is:

Device name: SRBOX

Error: 0x00002329

Message: "unable to open the SRBOX".

I really need your help because the study can't continue without it.

Raúl Oyuela Vargas, M.Phil.
Director Laboratorio de Psicología, PUJ
Carrera 5 N. 39-00 Edificio Manuel Briceño
Tel 3208320 Ext. 5713
Fax 3208320 Ext. 5717

-----Mensaje original-----


David K McFarlane

unread,
Apr 22, 2008, 8:30:06 PM4/22/08
to e-p...@googlegroups.com
Raúl,

My first guess is that the COM setting (COM1, COM2, etc.) on your USB to
serial converter does not match the COM setting of your E-Prime experiment.
First, check the COM setting of your converter -- I can't tell you how to do
that, but your IT staff should be able to help you there. Your converter
should have come with software to let you change its settings. Set it to
use COM1 if you can, otherwise use anything from COM2 to COM4 (E-Prime
cannot see anything above COM4).

Then, in your E-Prime experiment program, open the Experiment properties
(e.g., double-click on the Experiment object). Go to the Devices tab (I'm
doing this from memory, so I hope I get this right or someone else corrects
me). Open the SRBox object (I assume your experiment has one, otherwise you
will have to add it). Note the setting for COM port. Make sure that it is
set to the same port as your USB to serial converter. Note that the E-Prime
uses COM1 by default, so if you can set your converter to COM1 it should
already work with E-Prime. If you do need to change the SRBox COM setting
to match your converter, note that you will have to do this for *each*
experiment program, as this setting is stored separately for each program.
Finally, if you move the experiment between computers you might have to
change the SRBox COM setting to match each computer. As you can see, life
gets a lot easier if you can make sure that your SRBox can plug into
something that is already assigned as COM1!

Oh, you might also have to check other settings on your USB to serial
converter, e.g., baud rate, stop bits, data bits, etc.

BTW, if it were me, if at all possible I would install a real serial port
adapter into a free slot instead of using a USB to serial converter. The
converter may work fine, but I just feel better with a real card. Just my
unsolicited $0.02.

-- David McFarlane, Professional Faultfinder

Reply all
Reply to author
Forward
0 new messages