Skip to main content

Python library for interfacing with Cedrus XID devices, e.g. StimTracker, RB-x40, c-pod, and Lumina.

Project description

Python library for communicating with all Cedrus XID devices: StimTracker, RB-x40 response pads, c-pod, Lumina, and SV-1.

XID (eXperiment Interface Device) devices are used with software such as SuperLab, Presentation, and E-Prime for receiving input as part of stimulus/response testing experiments.

This handles all of the low level device handling for XID devices in python projects. The developer using this library must poll the attached device(s) for responses. Here's an example of how to do so, followed by an example of how to send a series of TTL signals:

import pyxid
import time

# get a list of all attached XID devices
devices = pyxid.get_xid_devices()

dev = devices[0] # get the first device to use

if dev.is_response_device():
    while not dev.has_response():

    response = dev.get_next_response()


sleep_flash = .3
for bm in range(0, 16):
    mask = 2 ** bm
    print("activate_line bitmask: ", mask)


The response is a python dict with the following keys:

pressed: True if the key was pressed, False if it was released
key: Response pad key pressed by the subject
port: Device port the response was from (typically 0)
time: value of the Response Time timer when the key was hit/released

Sending a TTL pulse signal via the library can be done via the following methods:


See the docstring for activate_line() for documentation on how to use it.


Each XID device has an internal timer. This timer can be reset via a USB command or automatically on the onset of a light sensor or onset of audio.

Project details

Release history Release notifications

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyxid2, version 1.0
Filename, size File type Python version Upload date Hashes
Filename, size pyxid2-1.0-py3-none-any.whl (17.0 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size pyxid2-1.0.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page