Acquiring Digital Codes

It is critical that we acquiring stimulus-locked digital codes so that we can bin the data according to stimulus type during analysis. This is also essential for creating event-related averages of the psychophysiological data (e.g. creating ERPs from EEG data) as it gives us the precise onset time of each stimulus. Below is a description of the hardware, software, and steps necessary for sending and acquiring such codes using the Biopac MP150.

Hardware

LabJack U3 DAQ device

The stimulus presentation computer interfaces with this device via USB. The device then outputs the 8-bit digital signal which is relayed to the MP150 via a 25-pin ribbon cable which connects to a parallel port on the MP150.

Winford DB25 Dual Connector Breakout Board

This breakout board (aka terminal board or terminal block) gives us an easy way of wiring the output from the LabJack U3 to the ribbon cable.

USB from stimulus presentation computer 8-bit digital output from I/O lines FIO0-FIO7. A separate wire connects each line to the breakout board. Wires are connected to screw terminals on the breakout board. Each terminal is connected to a single pin of the male/female DB-25 connectors. FIO0-FIO7 should be wired to terminals 2-9 of the breakout board. The ground should be wired to terminal 18 of the breakout board. A 25-pin ribbon cable connects the breakout board to the MP150

Software

Sending

The LabJack U3 can be controlled via several different programs and languages. We use the LabJack Python module to send codes via PsychoPy.

To date, I have only had success controlling the LabJack from a computer running the Mavericks OS (not Yosemite). The computer should have Xcode (including the Command Line Tools) installed. The libusb package should also be installed (see here for details). Finally, the LabJack exodriver and LabJack Python module should be installed.

Below is sample code for sending digital codes. Additional details can be found here and here.

# import LabJack module import u3 #NOTE: if running from PsychoPy you should use "from labjack import u3" # Initialize some stuff d = u3.U3() d.getCalibrationData d.debug = True # Set all FIO bits to digital output and set to low (i.e. “0") # The list in square brackets represent what’s desired for the FIO, EIO, CIO ports. We will only change the FIO port's state. d.getFeedback(u3.PortStateWrite(State = [0, 0, 0])) # To send a code, replace the first number in the list with a value between 0-255 # For instance, the following code would send a value of 15 by setting the first 4 bits to “1" d.getFeedback(u3.PortStateWrite(State = [15, 0, 0]))