Skip to main content

Python library for interfacing with Cedrus XID devices, e.g. StimTracker, Riponda, 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.

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.

Project details


Download files

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

Source Distribution

pyxid2-1.0.9.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyxid2-1.0.9-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file pyxid2-1.0.9.tar.gz.

File metadata

  • Download URL: pyxid2-1.0.9.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.1

File hashes

Hashes for pyxid2-1.0.9.tar.gz
Algorithm Hash digest
SHA256 152ae5905391f60376bf80b1b65e3f44509a474719d2f0934c312078ac0b7561
MD5 0579c6b2ff838a6c988c4ed0ceb605c8
BLAKE2b-256 1cba5d9da64d1737c6dcf9a04ac9b09d0c9ac7bccc9ce6516247449f9e851a0a

See more details on using hashes here.

File details

Details for the file pyxid2-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: pyxid2-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.1

File hashes

Hashes for pyxid2-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8ff6bafd6ee3aa3a06da72256844b1b4f475f732c27059134246ce05c9771e
MD5 1ea74f1a16c79a0f0e02f5559d4e4232
BLAKE2b-256 83849a5d42258dcb5a326e7ecb04d9759ad27379df060fc1c562054bbeaf75d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page