Response devices

807 views
Skip to first unread message

Tobi

unread,
Oct 29, 2009, 11:17:26 AM10/29/09
to E-Prime
Hi everyone,

I am wondering which kind of response device you are usually using for
your psychological experiments. There are special key sets for ERTS
and E-Prime, for example. However, standard devices like keyboards or
mice might also be frequently used.

Of course, keyboards and mice don't look that professional and not
everyone uses ERTS or E-Prime. Do you know any producer of hardware
that is well suitable for experimental psychology?

Thanks a lot and best regards,
Tobias FW

ben robinson

unread,
Oct 29, 2009, 11:20:15 AM10/29/09
to e-p...@googlegroups.com
we've been using playstation-type controllers for years.

David McFarlane

unread,
Oct 29, 2009, 11:50:06 AM10/29/09
to e-p...@googlegroups.com
Tobias,

OK, this question clearly lies outside the domain of PST Web Support,
so I will weigh in...

>Of course, keyboards and mice don't look that professional

Hmm, around here we use keyboards and mice extensively, but perhaps
we are not that "professional" :). We also use the PST SRBox, and if
you understand its operation then in principle you could use it with
any platform that will accept a stream from a serial port. Beyond
that, sometimes we (meaning I) build our own custom response boxes
and wire them up either through an SRBox, a commercial digital I/O
board, or even the lowly parallel port -- I have some mechanical
skills as well as electronic and technology skills, and that is my
job here. Of course you should have a machine shop and an electronic
shop as well as a skilled research technology professional at your
own institution to help with that (perhaps you are that
professional!). <rant> I really don't see how anyone can consider
themselves to do serious science in this day & age without such
assistance. </rant> In short, we just do whatever it takes to get the data.

Oh, Empirisoft also boasts a keyboard with millisecond latency
specifically for psychology research, as well as a USB button box
(puts them a bit ahead of PST there), but we have not tried any of
these. See http://www.empirisoft.com . And of course, some people
use touch screens, but I have to let those folks speak up for themselves.


Good question, I look forward to more responses.

-- David McFarlane, Professional Faultfinder

Michiel Spape

unread,
Nov 2, 2009, 9:26:12 AM11/2/09
to e-p...@googlegroups.com
Hi!
We have successfully implemented the brilliant XBOX360 controller. The software is somewhere on my website (www.cognitology.eu) I think, along with bad documentation. It requires a laptop with a serial port which then does the RT collection, but, more importantly, allows E-Prime (which then runs on another computer) to send a command which gets the controller to vibrate (it contains two rotors operating at different frequency and amplitude). It's not brilliantly accurate in terms of timing, but I hold the opinion that timing accuracy is over-rated for experimenters who know about balanced designs and randomisation... or who don't really mind subjects to be bored that much more to tears. On the other hand, they did seem to think the xbox controller made the experiment 'fun' .
Also, reviewers find it really cool! (or so we found: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2708333/)

Cheers,
Mich

Michiel Spapé
Research Fellow
Perception & Action group
University of Nottingham
School of Psychology
This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

ben robinson

unread,
Nov 2, 2009, 10:33:51 AM11/2/09
to e-p...@googlegroups.com
very cool!

Tobi

unread,
Nov 5, 2009, 1:54:39 PM11/5/09
to E-Prime
Thanks for your input. I somehow like the idea of doing some
handycraft even though I am not an educated craftsman. For my diploma
thesis I had to braze cable plugs in order to being able to put
controllers (via audio inlines) inside a shielded cabin.
In terms of response devices I now customised a keyboard ("Logitech
ultraflat"). I removed all buttons except 4 (those I need for the
current experiment) and attached a thin pad of foamed rubber (as
available in handicraft shops). I made holes for they keys that now
bunch out. The layer of foamed rubber is flush with the keyboards
surface. It looks kind of professional now and still isn't expensive
(18,- €).

However, timing might be an issue. Do you know how precisely USB
keyboards record the RT?

The XBox things sounds very sophisticated. What kinds of experiments
are you doing with it? Do you know about the timing precision?

Best,
Tobi

David McFarlane

unread,
Nov 5, 2009, 2:04:32 PM11/5/09
to e-p...@googlegroups.com
Tobi,

For more money you could also create custom
keyboard designs with the Ergodex DX1
(http://www.ergodex.com/mainpage.htm ), although
I don't think it's timing is any better than an
ordinary keyboard, and I like your inexpensive custom design better.

The latest reference I have on keyboard timing is
Plant, R. R., & Turner, G. (2009), "Millisecond
precision psychological research in a world of
commodity computers: New hardware, new problems?" Beh Res Meth 41: 598-614.

-- David McFarlane, Professional Faultfinder

Carlos

unread,
Dec 11, 2009, 4:53:16 PM12/11/09
to E-Prime
David,

Hi there, I am new to the group and see that you make your own boxes
to communicate with E-PRime. We are currently in the process of
converting some old IFIS response pads to work directly with E-Prime,
but are having difficulty getting E-Prime to detect every button press
and difficulty figuring out what type of characters E-Prime is
expecting. Since the SRBox Device is usually set to emulate the
keyboard I thought we could have the bread board we currently have the
pads connected to send out the hex code associated with the main
number keys on the keyboard. This didn't work very well and sometimes
buttons that were wired differently elicited the same output.

So my question is if you know what type of input E-Prime is expecting
from a device connected to the serial port?

Thanks,

Carlos Faraco
University of Georgia

On Oct 29, 10:50 am, David McFarlane <mcfar...@msu.edu> wrote:
> Tobias,
>
> OK, this question clearly lies outside the domain of PST Web Support,
> so I will weigh in...
>
> >Of course, keyboards and mice don't look that professional
>
> Hmm, around here we use keyboards and mice extensively, but perhaps
> we are not that "professional" :).  We also use the PST SRBox, and if
> you understand its operation then in principle you could use it with
> any platform that will accept a stream from a serial port.  Beyond
> that, sometimes we (meaning I) build our own customresponseboxes
> and wire them up either through an SRBox, a commercial digital I/O
> board, or even the lowly parallel port -- I have some mechanical
> skills as well as electronic and technology skills, and that is my
> job here.  Of course you should have a machine shop and an electronic
> shop as well as a skilled research technology professional at your
> own institution to help with that (perhaps you are that
> professional!).  <rant> I really don't see how anyone can consider
> themselves to do serious science in this day & age without such
> assistance. </rant>  In short, we just do whatever it takes to get the data.
>
> Oh, Empirisoft also boasts a keyboard with millisecond latency
> specifically for psychology research, as well as a USB button box
> (puts them a bit ahead of PST there), but we have not tried any of
> these.  Seehttp://www.empirisoft.com.  And of course, some people

David McFarlane

unread,
Dec 14, 2009, 3:29:34 PM12/14/09
to e-p...@googlegroups.com
Carlos,

At 12/11/2009 04:53 PM Friday, you wrote:
>David,
>
>Hi there, I am new to the group and see that you make your own boxes
>to communicate with E-PRime.

Just on that point, we have built very simple passive switch boxes
that we connect either to a digital I/O port (i.e., the parallel
printer port), or to the expansion connector on the SRBox. Although
I know enough about the SRBox that in principle I could build one
from scratch (no exotic circuitry in there), I have not yet gone to
the trouble of doing anything like that.


>We are currently in the process of converting some old IFIS response
>pads to work directly with E-Prime, but are having difficulty
>getting E-Prime to detect every button press and difficulty figuring
>out what type of characters E-Prime is expecting. Since the SRBox
>Device is usually set to emulate the keyboard I thought we could
>have the bread board we currently have the pads connected to send
>out the hex code associated with the main number keys on the
>keyboard. This didn't work very well and sometimes buttons that were
>wired differently elicited the same output.
>
>So my question is if you know what type of input E-Prime is
>expecting from a device connected to the serial port?

OK, now that I have considered your question... Again, to be
accurate I have never used the Serial Device in E-Prime, so for that
I would look at the SerialDevice topic in the online E-Basic Help
(and take that with a huge grain of salt, I find a mistake
practically every time I look in the E-Basic Help). But as far as I
can tell that just reads raw bytes from any serial device, it is up
to your particular device to determine what those bits mean and then
up to your E-Prime script to decode them.

But FWIW I will say a bit about what I know of the SRBox, which also
uses the serial port (which is not the same as being an E-Prime
Serial Device). OK, here is an excerpt from notes I made back in Aug
2001, and never finished (but is much more detail than PST will ever
give you)...

-----------------------
The SRBox communicates with the computer though a standard RS-232C
serial interface (DCE?; no handshaking). The SRBox ignores all
handshaking. Communication parameters are 9600 or 19200 bps (jumper
selectable, default is 9600), 8 data bits, no parity, 1 stop
bit. (At power on, sends &H7F)

Using these parameters, the SRBox sends a steady stream of key data
at a pace of 800 or 1600 Bps (jumper selectable, default is
800). In total, three byte/communication rates are possible: 800
Bps at 9600 bps (default), 800 Bps at 19200 bps, and 1600 Bps at
19200 bps (1600 Bps is incomptible with 9600 bps communication
rate). Note that at 800 Bps a byte is sent every 1.25 msec, while at
1600 Bps a byte is sent every 0.625 msec.

Each byte sent from the SRBox encodes the state of one bank of eight
devices (see control inputs below). Bank one consists of the five
built-in keys, the voice key, the refresh detector, and/or eight
external devices through the expansion connector. Bank two consists
of an additional eight external devices through the expansion
connector, plus the voice key and the refresh detector. Data bytes
are encoded according to the following table [this table does not
show up well in plain text, but here it is anyway]:

Bit # Bank 1 Function Bank 2 Function
0 On-board Key 1, or external Key 1 (expansion connector pin
#24) External Key 9 (pin #33)
1 On-board Key 2, or external Key 2 (pin #25) External Key
10 (A) (pin #34)
2 On-board Key 3, or external Key 3 (pin #26) External Key
11 (B) (pin #35)
3 On-board Key 4, or external Key 4 (pin #27) External Key
12 (C) (pin #36)
4 On-board Key 5, or external Key 5 (pin #28) External Key
13 (D) (pin #37)
5 Voice Key, or external Key 6 (pin #29) [?Voice Key, or?]
External Key 14 (E) (pin #38)
6 Refresh Detector, or external Key 7 (pin #30) Refresh
Detector, or External Key 15 (F) (pin #39)
7 External Key 8 (pin #31) External Key 16 (G) (pin #40)

The SRBox accepts input to control the state of built-in lamps and
external devices, and to control its own operation. (Same
communcation parameters as for output.) The lower five bits of an
input byte control one of two banks of devices (see control bits
below). The upper five bits control the operation of the
SRBox. When sending a control byte to the SRBox, it is necessary to
specify all three SRBox control bits. Note that there is no way to
read these control bits from the SRBox. Thus, if you wish to change
only one or two control bits, the program must itself store the prior
state of all the control bits so that it can add back in the ones
that are to remain unchanged.

For both banks, bits 0-4 control lamps or devices 1-5, where 0
deactivates the lamp or device, and 1 activates it. The control bits
operate as follows [again, this table comes out better in my original
Word document]:

Bit # Bank 1 Function Bank 2 Function
0 On-board Lamp 1, or external Lamp 1 (expansion connector pins
#7 & 6) External Lamp 6 (9) (pins #9 & 8)
1 On-board Lamp 2, or external Lamp 2 (pins #5 &
4) External Lamp 7 (A) (pins #11 & 10)
2 On-board Lamp 3, or external Lamp 3 (pins #3 &
2) External Lamp 8 (B) (pins #13 & 12)
3 On-board Lamp 4, or external Lamp 4 (pins #1 &
21) External Lamp 9 (C) (pins #15 & 14)
4 On-board Lamp 5, or external Lamp 5 (pins #22 &
23) External Lamp 10 (D) (pins #17 & 16)
5 Key Bank Select: 0 = bank 2, 1 = bank 1
6 Lamp Bank Select: 0 = voice key threshold & bank 2, 1 = bank 1
7 Transmit Data: 0 = Do not send data, 1 = Send data

Examples [another table that will not come out well in text]:
Control Code
Binary Hex Dec Result
0000 0001 01 1 Select key bank 2, stop data, set
voice key threshold to 1, turn on lamp 6 (bank 2), turn off lamps 7-10
0010 0000 20 32 Select key bank 1, stop data, set
voice key threshold to 0, turn off lamps 6-10 (bank 2)
0100 0001 41 65 Select key bank 2, stop data, turn on
lamp 1, turn off lamps 2-5
0110 0001 61 97 Select key bank 1, stop data, turn on
lamp 1, turn off lamps 2-5
1000 0000 80 128 Select key bank 2, send data, set
voice key threshold to 0, turn off lamps 6-10 (bank 2)
1010 0000 A0 160 Select key bank 1, send data, set
voice key threshold to 0, turn off lamps 6-10 (bank 2)
1101 1010 DA 218 Select key bank 2, send data, turn on
lamps 2, 4, & 5, turn off lamps 1 & 3
1110 1010 EA 234 Select key bank 1, send data, turn on
lamps 2 & 4, turn off lamps 1, 3, & 5
-----------------------


Whew! Here is a shorter view for you: First, you might have to send
something like &HE0 to start the SRBox sending data from key bank 1
(the on-board keys) (and turn off the on-board lamps). At that point
the SRBox will send a steady stream of bytes to the serial port, at
the configured bps and communication rate (default 800 cps at 19200
baud). Each bit encodes the state of one button, so, e.g., button 1
sends &H01, button 2 &H02, button 3 &H04, etc.; and buttons 1 & 3
simultaneously send &H05, etc. You may then decode the byte with
If...Then, or masking unwanted bits with a bitwise And.

As to "emulating the keyboard", clearly for that E-Prime
transparently reads a byte from the SRBox, translates that into ASCII
code for the appropriate numbers (e.g., button 1 becomes &H31, i.e.,
"1"), and uses something like InputDevice.InsertResponse to insert
that string into the KeyboardDevice queue for use there. I would
rather start by using the device directly, and once I got that to
work I might fiddle with getting emulation to work.

OK, that's probably both more and less than you asked for, but there it is.

David McFarlane

unread,
Dec 14, 2009, 3:52:14 PM12/14/09
to e-p...@googlegroups.com
Oops, I meant to preface my little report with an explanation of how
to figure this stuff out for yourself (because, you know, you should
never take my word for any of this). I just put the SRBox through an
old terminal emulator that will show incoming characters as
hexadecimal. I used an old DOS shareware program called Terminal
Plus!, apparently still available for download (find it through Google).
>--
>
>You received this message because you are subscribed to the Google
>Groups "E-Prime" group.
>To post to this group, send email to e-p...@googlegroups.com.
>To unsubscribe from this group, send email to
>e-prime+u...@googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/e-prime?hl=en.

Carlos

unread,
Dec 17, 2009, 5:01:45 PM12/17/09
to E-Prime
Dave,

Thank you for your very detailed message. I will take a good look at
this and let you know what we find. It may be a bit before I get back
to you though since I will be leaving out of town this weekend for the
break.

Thanks again,

Carlos Faraco
University of Georgia

> ...
>
> read more »

David McFarlane

unread,
Feb 17, 2010, 12:53:07 PM2/17/10
to e-p...@googlegroups.com
At 2/16/2010 06:07 PM Tuesday, Carlos wrote:
>David,
>
>Anyways, my colleague (who is the one mainly in charge of trying to
>configure our response pads) and I have looked at this and tried to
>implement a few things. So far we haven't had any luck. We don't have
>an SRBox from E-Prime so we can't really route anything through there
>or even try to figure out in more detail how it works. You seemed to
>have provided that though in your e-mail so I don't think is an issue
>at this point. It just seems that E-Prime does not want to correctly
>interpret what we are sending to it.
>
>I have a few more questions for you if you don't mind.
>
>1) Should we be setting the SRBOX Object/Device in E-Prime to be
>emulating the keyboard?

That is entirely up to you, it makes no difference to how E-Prime
gets the input from the SRBox. It may simplify the testing of your
input masks -- you can use a Keyboard mask (using the same values as
your SRBox will use) to test your program without the SRBox, then
when you add the SRBox you have everything ready.

>2) What type of information should we be having the breadbox send out?
>Should this be in hex? We have verified that the breadbox is sending
>out the information we configure it so send, but E-Prime doesn't seem
>to happy with whatever type of output we send to it.

I thought I covered that in my earlier post.

>3) You said the E-Prime SRBOX sends out &H7F when it powers on. Is
>this something that E-Prime has to detect?

Not as far as I know, I simply recorded an observation that I made
(hence I enclosed that in parentheses).

>4) Does the SRBox send a steady stream of bytes to E-Prime at the
>speed of 800 bytes per second even if no button is pressed?

Yes.

>5) If no button is pressed, what will the SRbox send to E-Prime?

It sends a steady stream of &H00 bytes.

>In your reply you said: In your reply you mentioned:Each bit encodes


>the state of one button, so, e.g., button 1 sends &H01, button 2 &H02,
>button 3 &H04, etc.; and buttons 1 & 3 simultaneously send &H05, etc.
>You may then decode the byte with If...Then, or masking unwanted bits
>with a bitwise And
>

>Would that be the answer to the last two questions?

Yes, indeed.

>6) If, for example, button 1 is pressed, does the SRBox send
>"00000001" to E-Prime immediately? Is there any debounce processing
>needed? By any chance do you know how they achieve the "0 millisecond
>debounce period" as declared in their website?

It does send the "00000001" (or &H01, or 0x01, which I find easier to
read). I do not recall any debounce circuity in the SRBox. However,
since it sends a new datum only once every 1/800 s = 1.25 ms, the
buttons have plenty of time to debounce between each datum.

Hope that helps,

Carlos

unread,
Feb 24, 2010, 1:37:47 PM2/24/10
to E-Prime
To all,

Just to make things simple for everyone, here is what e-prime would be
expecting regardless of what response pads you are using.

Constant data stream when nothing is pressed = 00000000 = &H00
Button 1 = 00000001 = &H01
Button 2 = 00000010 = &H02
Button 3 = 00000100 = &H04
Button 4 = 00001000 = &H08
Button 5 = 00010000 = &H10
and so on up until 8 buttons.

I want to thank David for his help on this! Without his input we might
not have figured this out. We were thinking what E-Prime was expecting
was much more complicated than this, and kept on straying farther and
farther.

Hope this helps everyone

-Carlos Faraco

Boushra Dalile

unread,
Aug 19, 2016, 8:13:24 AM8/19/16
to E-Prime
Hi Ben,

I set up a playstation 3 controller in our lab and managed to get it to work with e-prime (importantly L1 and R1, which are, according to device properties and as eprime understands them, 5 and 6 respectively). However, the L2 and R2 buttons do not seem to work (i.e., I do not know what numbers/letters to use as allowable responses in the Input Mask. My Input Mask is a Joystick.

When I look at the PS3 properties in control panel, I see that L2 and R2 are labelled Z Axis and are indexed on a continuum as opposed to a simple button press as is the case with other buttons (except the left and right sticks, naturally). Is there any way to get eprime to recognise them as buttons with specific labels? Z is not an allowable response, nor are L2 and R2. I tried using {} and without.

Any help would be greatly appreciated,

B

Ben Robinson

unread,
Aug 19, 2016, 11:47:38 AM8/19/16
to eprime
Hi Boushra. Those should be buttons 7 and 8. Let me know if that works.

Ben

--
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

Boushra Dalile

unread,
Aug 20, 2016, 8:46:02 AM8/20/16
to E-Prime
Hi Ben!

Thanks for your response. Button 7 and 8 are 'start' and 'select', respectively. I am using this PS3 controller: https://www.playstation.com/manual/pdf/PS3-02_03-1.5_2.pdf

B
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+u...@googlegroups.com.

Ben Robinson

unread,
Aug 20, 2016, 3:11:31 PM8/20/16
to eprime

Hmmm. What happens if you start pushing buttons on the controller when the input box comes up asking for subject number and session number? Do you see the associated keyboard values for the buttons? Or if you set up an object to receive {any} keyboard input, record the response to your data file, and then press the relevant buttons on the controller. You can probably figure out the mapping that way. I hope.


To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.

Boushra Dalile

unread,
Aug 22, 2016, 6:04:46 AM8/22/16
to E-Prime
Hi Ben,

Really good suggestions! but unfortunately the input box that asks for subject/session numbers does not take input from the PS3 controller, but only from the keyboard for some reason.
I set up the input mask to {ANY} and it received input from all buttons except L2, R2 and also all the directional buttons e.g. >, < ...

May I know what playstation-type controllers do you use and do all the buttons happen to work without exception as in my case?

Thanks for your help,
Boushra

Ben Robinson

unread,
Aug 22, 2016, 7:51:12 AM8/22/16
to eprime

We use one of these, with some associated software from Logitech that lets you map different keyboard buttons to the controller buttons.
http://support.logitech.com/en_us/product/precision-gamepad


To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe@googlegroups.com.

To post to this group, send email to e-p...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages