Trigger Code Hardware Setup

Setting up a PC to use a PCIe parallel port card

This information is mostly for Aaron or anyone else who might be setting up a PC for the first time.

You will need to go to https://www.highrez.co.uk/Downloads/InpOut32/default.htmarrow-up-right and download the latest binaries. Unzip the file, then run as administrator Win32\InstallDriver to install the drivers system-wide.

Copy drivers to experiment folder

Once this is done, at least for PsychoPyarrow-up-right, experimenters will also need to copy the files inpoutx64.dll and inpoutx64.lib from the x64 folder, and then the file inpout32.h from the Win32 folder. Place a copy of all of these in the same folder as your PsychoPy experiment file (the one with the .psyexp filetype).

Setting up a PC to use the USB-1208FS

An alternative to a PCIe card (especially useful with laptops and mini-PCs) is the USB-1208FSarrow-up-right DAQ. We have one in the lab (enclosed in a literal black box). To make this work, you first need to install the drivers and other support software, specifically the MCC DAQ Softwarearrow-up-right. This includes several necessary components including InstaCal and Universal Library. Installation is pretty straightforward — just run the installer and say yes to everything it asks, including rebooting as necessary.

Using the USB-1208FS with PsychoPy

This PsychoPy forum post arrow-up-rightwas helpful. The first step, installing Universal Library, will have already been done when you installed the MCC DAQ software in the previous step. Now, download and install PyUniversalLibraryarrow-up-right. "Install" here basically means "save it somewhere on the PC where you can acess it", and then open PsychoPy, go to Preferences -> General -> Paths, and add the full path to the PyUniversalLibrary folder (e.g.,

The above-linked forum post also notes PyUniversalLibrary can be installed using pip.

My experience was that PyUniversalLibrary did not work out of the box. Specifically, the line in UniversalLibrary.py that reads:cbw = ctypes.windll.cbw32

Needs to be changed to: cbw = ctypes.WinDLL('/Path/to/UniversalLibrary/cbw64')

Note that the above is case-sensitive (change windll to WinDLL ) and the 32 needs to be changed to 64 (unless you're running a 32-bit version of Windows, which you probably aren't). As well, the sample code on that PsychoPy forum post should be used as the basis for sending codes in your experiment; the typical parallel code will not work. NCIL's GitHub organization page has a repository with sample code, including the modified version of UniversalLibrary.py as per the notes above.

Last updated

Was this helpful?