Skip to main content

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.

Minimal samples for collecting responses and sending event markers are available in the Git repo.


Response collection in pyxid

When a physical key is pressed on the device, a set of bytes describing it go into the serial buffer. This also occurs when the physical key is released. Calling poll_for_response() makes pyxid check the serial buffer for bytes constituting a response packet, and put a response object in its internal response queue. It does so once per poll_for_response() call. Calling get_next_response() pops a single response from the response queue. If you want to avoid seeing more responses than necessary, you can use flush_serial_buffer() to prevent more responses from being added to the queue by poll_for_response(), and you can clear already processed responses with clear_response_queue().

The response object is a python dict with the following keys:

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

For an example see sample/responses.py


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

set_pulse_duration()
activate_line()
clear_line()
clear_all_lines()

For an example see sample/event_markers.py


Timers

Each XID device has an internal timer. This timer can be reset via reset_timer() or automatically on the onset of a light sensor or onset of audio. It's commonplace to reset the timer at the start of the experiment and/or at the onset of a simulus.

Metadata

Release files for pyxid2 1.0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyxid2 1.0.9
File Size Uploaded
pyxid2-1.0.9.tar.gz 11.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyxid2 1.0.9
File Interpreter ABI Platform
pyxid2-1.0.9-py3-none-any.whl Python 3 none any Details

Total release size: 23.6 kB

Release files / pyxid2-1.0.9.tar.gz

Download URL pyxid2-1.0.9.tar.gz
Size 11.8 kB
Tags Source
SHA-256 checksum
How to use checksums
152ae5905391f60376bf80b1b65e3f44509a474719d2f0934c312078ac0b7561
BLAKE2b-256 checksum
How to use checksums
1cba5d9da64d1737c6dcf9a04ac9b09d0c9ac7bccc9ce6516247449f9e851a0a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.1

Release files / pyxid2-1.0.9-py3-none-any.whl

Download URL pyxid2-1.0.9-py3-none-any.whl
Size 11.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c8ff6bafd6ee3aa3a06da72256844b1b4f475f732c27059134246ce05c9771e
BLAKE2b-256 checksum
How to use checksums
83849a5d42258dcb5a326e7ecb04d9759ad27379df060fc1c562054bbeaf75d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.11.1

Release history Release notifications | RSS feed

This release

1.0.9 This release

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page