TECHNICAL INFORMATION
COMPUTER-INTERFACING FOR DUMMIES: INTERFACING PERIPHERAL DEVICES TO YOUR MACINTOSH PC
Bryan Roche and Simon Dymond
NATIONAL UNIVERSITY OF IRELAND - MAYNOOTH AND ANGLIA POLYTECHNIC UNIVERSITY, CAMBRIDGE
Editors' note: the link below under the heading 'Download some sample PsyScope scripts' has been changed to: http://www.may.ie/academic/psychology/software.shtml.
In a previous paper (Roche, Stewart, & Barnes-Holmes, 1999), the graphic experiment generation software PsyScope (Cohen, MacWhinney, Flatt, & Provost, 1993) was reviewed and its relevance to behavioral research in the domain of language and cognition was outlined. Many behavioral researchers have since explored the potentials of this freeware application for the easy generation of behavioral experiments, particularly in the area derived stimulus relations. In research contexts where the only behavior of importance is subjects’ response patterns on a keyboard, the experimenter needs only to arrange for the appropriate task presentations and the recording of responses. All of this is achieved easily using PsyScope, which is available for free download at http://psyscope.psy.cmu.edu/.
Here we provide a brief introduction to the interface features of that program. We believe that this single feature of PsyScope will be invaluable to researchers wishing to establish communication between a PC and any analog or digital recording or stimulating device without the need for basic programming skills.
Why the need to interface?
Behavioral researchers in laboratories around the globe wish to integrate the delivery of computer-based training and testing procedures with the activity of other analog and digital recording and stimulating devices. Some laboratories, for instance, require that computer generated stimulus presentations be tied temporally to the administration of mild electrical stimulation to subjects, the operation of a food chamber, or the creation of an event mark on an ERPs or other polygraph record. Fortunately, most of these common devices allow the direct input of external triggering cables for just this purpose (e.g., a manual event marker for a polygraph, or a manual button press for food delivery in a conditioning chamber). The problem is that arranging for the automated electrical activation of these triggering devices by a personal computer is a sophisticated problem for psychologists who are not experienced computer programmers. For this reason, and for the benefit of other laboratory researchers, we wish to share our own experience in the use of PsyScope in interfacing PCs with a variety of recording and stimulating devices.
The PsyScope Button Box
PsyScope offers an easy solution for interfacing any digital or analog device to your Macintosh PC without the need for programming skills. For this purpose a peripheral piece of hardware known as the PsyScope Button Box must be purchased at a cost of $400 USD (go to http://psyscope.psy.cmu.edu/bbox/index.html for order information). The Button Box is an external response unit designed to serve as a two-way conduit of commands from and to peripheral devices of all kinds. The Button Box is connected to the Macintosh PC via the serial port or USB port (using a serial-USB adaptor). No drivers or additional software is required. Users must simply inform PsyScope that the button box is being used, by selecting it as an input device from the PsyScope menus.Footnote
The Button Box houses three large colored response keys that can be used as response keys for any PsyScope script. Many PsyScope users already possess and use a Button Box as a response interface for subjects, but may be unaware of its potential as an interfacing device. The interface features of the Button Box are made possible by a variety of digital and analog input and output ports housed at the rear of the box. One input port, for instance, is designed to receive a 3.5 mm phono plug so that throat microphones or other sound sources can be used to trigger reaction time recordings or the presentation of stimuli. The use of the microphone input as a stimulus or response event in PsyScope can be achieved entirely through the use of intuitive menus and dialog boxes.
Of particular use for controlling a multitude of external devices is the generic 15-pin output port that we now use extensively in our research. This port transmits a 3-volt pulse whenever one of three lights on the face of the button box is illuminated by the software script created by the experimenter. Thus, creating an event marker for a polygraph machine is as simple as creating a button box light command to coincide with the relevant stimulus presentation. Light commands are created through the graphic interface in the same way as other events in the script. Figure 1 illustrates how the Button Box command is created simply by dragging the Button Box tool from the bottom left of the tool menu to the task sequence on the right, and then double clicking on the command event to specify its features (e.g., onset time, duration) in various menus. Any or all of the three lights may be illuminated simply in this way. Figure 2 shows how the duration of lights can also be varied through the Event Attributes menu. As long as a light is illuminated a 3-volt pulse is being supplied via the 15-pin output port. This means that devices requiring continual power may also be controlled by the PsyScope Button Box.
The fact that the Button Box houses three lights (Red, Green, and Yellow) means that three different cables may be drawn independently from the 15-pin output port, each electrically activated by the illumination of a different light. This feature may be important, for instance, if the researcher wishes a specific computer-generated stimulus to coincide with the triggering of an electric shock stimulator, but also requires that event marks be placed on an ERPs or EEG record to coincide with the occurrence of other events in the PsyScope script at other times (e.g., other discriminative or respondent stimuli). In addition, there are five other live pins that can be used for further independent voltage outputs. These are described in the user manual that comes with the Button Box. The manual also describes how the Button Box can be connected to an IBM-compatible PC for use with other software programs, although this option will require additional computer skills.
A diagram of the 15-pin output port is presented in Figure 3 . The active pins for various light illuminations on the Button Box are shown. For instance, a cable connecting the top right pin and the ground pin to the analogue event marker input of a polygraph will carry a 3-volt pulse when the red light is illuminated by the PsyScope script. It requires little technical expertise to create a custom cable with the relevant pins connected to a jack to suit the external device to be controlled.
The temporal resolution of PsyScope scripts
PsyScope can control stimulus presentations and the delivery of output pulses with a temporal resolution of 1 ms. High temporal resolution is critical for ERPs, EEG and other polygraph recording. It is important to note, however, the temporal resolution of the vast majority of computer hardware cannot ensure such high resolutions. The PsyScope Button Box also offers a solution to this problem. Specifically, the box itself can be assigned as an independent timing device for all events in the experiment. As the button box is not burdened with the running of system software or the presentation of memory-demanding stimuli (e.g., movie and sound clips) it can ensure accurate timing at each stage of the experiment. To use the Button Box as the external timing device simply select it as the timing device from the PsyScope menus. In any case PsyScope can also record all timing statistics for all events in the experiment (choose the Data Output sub- menu). This will provide feedback in the data file as to the exact onset and offset times of all events. In the authors’ experience these usually deviate no more then 3 or 4 ms from the scheduled onset and offset times.
Using the Button Box with iMac computers
As the Button Box was designed primarily for older machines, it assumes connectivity to the Macintosh computer via the modem serial port. If a researcher wishes to connect the Button Box to a Macintosh via the USB port the following line should be typed directly into the script anywhere towards the beginning of the script, but preferably in the paragraph headed ExperimentDefinitions (choose Edit This Script from the File menu).
BBoxPort:B
This line switches the default port for the Button Box connection from the modem port to the printer (or USB) port for that script. The PsyScope user should have no other need to see the raw script and will be able to create a variety of interesting and powerfully interactive experiments entirely within the graphic interface.
Download some sample PsyScope scripts
The PsyScope application and a sample respondent conditioning program that controls two external devices may be downloaded from http://www.may.ie/academic/psychology/software.htm. This script can be easily modified to suit researcher’s individual needs, or the graphic event marker command events can simply be copied and pasted from one script to another. Relational training scripts for equivalence and other derived relations may also be downloaded at that web site.
REFERENCES
Cohen J. D., MacWhinney B., Flatt M., & Provost J. (1993). PsyScope: A new graphic interactive environment for designing psychology experiments. Behavioral Research Methods, Instruments and Computers, 25, 257-271.
Roche, B., Stewart, I. & Barnes-Holmes, D. (1999). PsyScope: An easy-to-use graphical system for designing and controlling equivalence experiments. The Experimental Analysis of Human Behavior Bulletin, 17, 5-7.