How to set up E-Prime and LabStreamingLayer (LSL)

You can send event triggers from E-Prime via LSL to mbtStreamer software, and sync them with EEG data. We give you an overview of possible setups, but if you need sample scripts we'll be happy to share them.

If you are using the Smarting device, with Smarting Streamer software, you can also follow along the steps below! Recording interface for PRO line systems looks a bit different, but the functionalities in this case are the same.

If you're using multiple PCs for your experiment, you can run E-Prime on one PC, and record the LSL stream on the other (including other LSL streams, such as EEG).

Alternatively, you can record all LSL streams on the same PC where E-Prime is running. However, these 2 setups have different settings in E-Studio, so it's important to read the directions below.

If you're not familiar with LSL, please read this blog first. For more practical LSL examples in E-Prime, see their github page.

USING 2 PCs

LSL streams can be discoverable on multiple devices, as long as they are on the same LAN network.

In E-Prime, LSL stream opens when the experiment starts. E-Prime will wait a certain period of time for the LSL stream to be "consumed" before starting the paradigm. This time can be set manually, but usually it's around 30s.

On the second PC, you can use our mbtStreamer software to catch E-Prime marker stream and record it with EEG data stream. Follow the steps below when you have your script set up:

STEPS

  1. Run all LSL streams you want to include in your study.
  2. Open E-Prime with LSL scripts included.
  3. Run the experiment.
  4. By default, you'll have around 30s to catch the marker stream from E-Prime + rest of the streams and start recording.

USING 1 PC

E-Prime takes over the screen once the experiment starts. So it's not possible to catch LSL streams and start recording when on one PC.

Here, you'll need to use LabRecorder software to record LSL streams.

E-Prime can control LabRecorder actions automatically through Remote Control Server (RCS). This means it can start recording data in the background once the experiment starts.

To enable RCS, you'll need to first set up a Socket as shown in image below. Server is set to localhost, as we're recording and streaming all on one PC.

Once you set up the socket, you'll need to add a script that ensures LabRecorder + E-Prime automatic communication. This script is labeled "LabRecorderInit" in our sample experiment.

Through this script, we're able to automatically select all available LSL streams and start recording them in a file. Once, you have the script set up, follow the steps below.

STEPS

  1. Run LabRecorder.
  2. Run all LSL streams you want to include in your study.
  3. Run the experiment.
  4. E-Prime will let you know if there was a consumer found for the LSL stream. That is, if LabRecorder started recording it.

 

We have sample scripts for both setups, so please reach out if you need us to share them with you: support@mbraintrain.com