Overview
PsychoPy is an experiment builder that presents stimuli and records participant responses. LabScribe software acquires and saves physiological data. When configured to communicate, PsychoPy can send messages to LabScribe so that experiment events can be associated with the physiological recording.
This technote explains how to set up that communication using the sample Anti-Saccade experiment. This sample experiment was provided by Dr. Jacquelyn Berry and Calvin Pugmire at Rensselaer Polytechnic Institute.
Note: LabScribe has its own built-in Experiment Builder for setting up straightforward experiments involving images, colors, sounds, or text. For more in-depth experiments, PsychoPy communication can be used. Visit the Experiment Builder using LabScribe page for additional information and sample tutorials showing how to easily set up your experiment in LabScribe. LabScribe also includes many preconfigured labs and experiments, including HP-11: Experiment Builder using Macros, HP-07: The Stroop Effect, HP-13: The Gaze Cue Paradigm, and HP-16: Eriksen Flanker Test.
Background
The Anti-Saccade experiment sends event messages from PsychoPy to LabScribe during the task. LabScribe records these messages as marks alongside the physiological signals. The marks identify when specific experiment events occur, making it easier to locate and compare those events with the recorded data. When the recording is exported, the marks can be exported with the data.
Prepare the PsychoPy Experiment
Download the sample ZIP file: Anti-Saccade (LabScribe) sample.
- Save the ZIP file to the computer desktop for easy access.
- Extract the ZIP file. Keep the extracted files together so PsychoPy can find any experiment resources.
- Open PsychoPy Builder and open the Anti-Saccade (LabScribe) .psyexp file. 4. Review the experiment and confirm that it opens without missing-file warnings.

Figure 1: PsychoPy Builder software, with the Anti-Saccade (LabScribe).psyexp PsychoPy Experiment file loaded.
Configure LabScribe
LabScribe can receive messages from PsychoPy through the server port.
- Open LabScribe.
- Go to the Edit – Preferences menu.
- Click on the Options tab.
- Under Experiment Server Port, select 3000.

Figure 2: Edit – Preferences – Options tab, with Experiment Server Port 3000 selected.
- In the Channel Tab, enable the channels you want to use to record data. For the following example, a pulse and HR channel have been enabled.
- Click OK to close the dialog window.
- Start the recording by pressing the red REC button.
- Go back into the PsychoPy application window.
- Run the PsychoPy experiment.
- In the PsychoPy Runner, ensure the Anti-Saccade (LabScribe).psyexp is loaded under Files, as shown below.

Figure 3: PsychoPy Runner, with Anti-Saccade (LabScribe) participant and session field dialog window.
- Press OK to start the experiment.
- Upon cmopletion of the experiment, PsychoPy will show a message under the Stdout tab.

Figure 4: PsychoPy Runner Stdout tab.
- Go back into the LabScribe application. You will now see marks in the recording indicating event messages sent from PsychoPy.

Figure 5: LabScribe Main window, with event marks sent from PsychoPy.
- To view all Marks, select the drop down arrow to the right of Mark in the toolbar. Click on a mark to go to that location in the data file. To view all marks, select Marks.
Figure 6: Marks list view from the LabScribe Main window.
Figure 7: Marks dialog window.
Exporting Data and Marks from LabScribe
1. Click File – Export.
- Choose a File name and Save as type.
- A data export dialog prompt window will appear.

Figure 8: Export Parameters dialog window.
- LabScribe will prompt a Data Exported dialog message.
*

Figure 9: Data Exported dialog message window.
- When Exported to an Excel spreadsheet, LabScribe will export the Time in the first column, any other channels in sequential order, and in the final column will be the PsychoPy Marks.

Figure 10: Channel Titles, Columns A (Time), B (Pulse), and C (Heart Rate).

Figure 11: Column D, with PsychoPy event markers.