Skip to main content

OpenSesame Plugin: Parallel Port Trigger

An OpenSesame plugin for sending stimulus synchronization triggers through the parallel port to data acquisition systems.

Copyright (C) 2013-2026 Bob Rosbag, Per Sederberg, Edwin Dalmaijer and contributors

Contributions: Code is based on the work of Per Sederberg. Debugged and polished by Edwin Dalmaijer.

About

In EEG/ERP studies it is common to send triggers to mark the timestamp for significant events (e.g., the onset of a trial, presentation of a particular stimulus, etc.). Triggers are typically bytes that are sent via the parallel port to data acquisition systems.

The plugin has two items: an Init item, which should be placed at the beginning of an experiment, and a Send item, which sends a trigger.

Init item:

  • Dummy mode for testing experiments without a parallel port.
  • Verbose mode prints messages about what the items do.
  • Port Address for Windows: hexadecimal, starting with 0x (0x378; Device Manager shows it as 0378), for Linux: port number (0 in /dev/parport0).

Send item:

  • Value is an integer between 0 and 255 and specifies the trigger byte. It may be a variable, such as {trigger}.
  • Enable pulse mode: the port is set back to 0 after the pulse time (a pulse).
  • Pulse time (ms) is the time in ms before the port is set back to 0. It may be a variable.

In the script these settings are pulse_mode and pulse_time. Up to version 5.0.2 they were called duration_check and duration: an experiment or inline script with the old names still works, the send item converts them and gives a warning. Save the experiment to store the new names, and use the new names in inline scripts (items['name'].var.pulse_time). Note that versions up to 5.0.2 don't know the new names: they ignore them and send no pulse, the value stays on the port. Use the same version of the plugin on every computer that runs the experiment.

With pulse mode, the send item logs the pulse time as pptrigger_pulse_time, and also as pptrigger_duration, its name up to 5.0.2.

There are two ways to send a trigger:

  • Pulse mode: one item sends a pulse, e.g. value 23 for 10 ms, and then sets the port back to 0.
  • Without pulse mode: the value stays on the port until another item changes it. For example, one item sends 23 and a later item sends 0; the trigger then lasts as long as the time between the two items.

At the end of the experiment, also after an abort, the port is set back to 0.

In dummy mode no port is opened, but the items still check their values and wait for the pulse time, so an experiment behaves the same as with a parallel port.

Linux and Windows are supported. macOS is not: pyparallel is only installed on Linux and needs the Linux parallel port driver (/dev/parportX); only dummy mode works there. On Linux the pyparallel package is used. On Windows the bundled InpOut32 driver (inpout32.dll / inpoutx64.dll) is used. This driver is installed the first time it is used, which needs administrator privileges: run OpenSesame once as administrator (see InpOut32Drv_ReadMe.txt).

Documentation: https://osdoc.cogsci.nl/4.1/manual/devices/parallel/

Installation

Install the plugin with pip, in the Python environment of OpenSesame:

pip install opensesame-plugin-parallel_port_trigger

License

This plugin is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version (GPL-3.0-or-later).

The full license text is in the file COPYING, and is also available at https://www.gnu.org/licenses/gpl-3.0.html.

This plugin contains works of others. The bundled InpOut32 driver DLLs (inpout32.dll, inpoutx64.dll) are Copyright (c) 2003-2015 Phil Gibbons, portions Copyright (c) 2000 logix4u.net, and are distributed under the MIT license; its text is in opensesame_plugins/parallel_port_trigger/parallel_port_trigger_init/InpOut32Drv_license.txt, next to the DLLs.

Documentation

Installation instructions and documentation on OpenSesame are available on the documentation website:

Metadata

Release files for opensesame-plugin-parallel-port-trigger 5.1.2

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

Source distribution (sdist)

Source distribution for opensesame-plugin-parallel-port-trigger 5.1.2
File Size Uploaded Provenance Actions
opensesame_plugin_parallel_port_trigger-5.1.2.tar.gz 111.4 kB Without provenance Details for opensesame_plugin_parallel_port_trigger-5.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for opensesame-plugin-parallel-port-trigger 5.1.2
File Interpreter ABI Platform Actions
opensesame_plugin_parallel_port_trigger-5.1.2-py3-none-any.whl Python 3 none any Details for opensesame_plugin_parallel_port_trigger-5.1.2-py3-none-any.whl

Total release size: 225.6 kB

Release files / opensesame_plugin_parallel_port_trigger-5.1.2.tar.gz

Download URL opensesame_plugin_parallel_port_trigger-5.1.2.tar.gz
Size 111.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7459f7d2b62056b6ee82e6eb716c6c17463e29dc2278e8cd2e7774d7aa20fed9
BLAKE2b-256 checksum
How to use checksums
09f6d250a1ae95e65d6b2767a4dcb3b94050c0e8df5d197ce54c3be3c3f7a37d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / opensesame_plugin_parallel_port_trigger-5.1.2-py3-none-any.whl

Download URL opensesame_plugin_parallel_port_trigger-5.1.2-py3-none-any.whl
Size 114.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e0470f571ada209868c883ba879e8e16eb8e9cf96785e84549b194f4e8d65ce1
BLAKE2b-256 checksum
How to use checksums
dcee9e46828de94428a68e6dede5bc0a2d803a757b100a623a5700491b125887
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Security for opensesame-plugin-parallel-port-trigger 5.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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