Introduction

Sending markers from E-Prime to the LPT (parallel) port is necessary when using equipment like BIOPAC and Biosemi. However, not all modern PC's have an LPT port anymore (laptops). Therefore, SOLO created a cable which goes from USB to parallel (called USBParMarker), and enables researchers to use a laptop and still send markers to for example BIOPAC or Biosemi. For more information about the importance of markers, see Markers and Events. Below, a short manual of how to send markers to the serial port (using the USBParMarker) is given.

Short manual

A sample task can be found here.

Make sure the USBParMarker is connected (through USB) to your computer. It does not have to be connecting to another device on the parallel end (like BIOPAC or Biosemi).

Find the COM port number

For E-Prime to be able to communicate with the USBParMarker, you need to COM port number to which the USBParMarker is connected.

  • Right click on Windows Start button and click Device Manager (click Yes when Windows asks whether you want to allow this app to make changes to your device).
  • Go to Ports and find the right port number, found after COM (can be called Arduino Leonardo, but not necessarily).

Add the USBParMarker device to the E-Prime experiment

The USBParMarker is added to the E-Prime experiment in the following way:

  • Go to Edit ⇒ Experiment ⇒ Devices ⇒ Add ⇒ Serial ⇒ Ok
  • Edit the settings:
    • Select Serial device in Devices, click Edit
    • Name: USBParMarker
    • COM Port: (select the right COM port here)
    • Bits per second: 115200
    • Leave rest at default.

Create sendMarker subroutine

In the User Script, create a sub that makes it easier to send markers. Put following in the User Script:

'Subroutine for sending marker:
Sub sendMarker(MarkVal As Integer)
   
USBParMarker.WriteByte MarkVal
End Sub

When you want to send a marker, you can do so easily by using the sendMarker Sub:
sendMarker <value>

This method sends a marker at that exact timepoint.

Reset marker value

It is good practice to reset the marker value at the start of your experiment, so that you can be sure that the marker value at the start of your experiment is 0. Add an inline to the start of the experiment, name it something like "InitExperiment" and add the following to the Inline:

'reset port
sendMarker 0
sleep 100
sendMarker 255
sleep 100
sendMarker 0
sleep 10

Send marker during object by using Task Events

When you want to send markers at the on- or offset of objects, that is send a marker during the execution of an object, it is necessary to use Task Events.

To set Tasks Events:

  • Go to the Properties of the object during which you want to send a marker. 
  • Go to the Task Events tab.
  • Add OnsetTime event: click Add ⇒ double click [ObjectName].OnsetTime
    • Set Task
      • Name: (Choose a Task), click on ... then double click on USBParMarker
      • Select Action: WriteByte
    • Set Parameter
      • Source: (custom)
      • Custom: marker value. This can either be a value (e.g. 1) or your can reference an attribute in a list (e.g. [markerValue]).
      • Data Type: Integer
      • Enabled: Yes
  • Add OffsetTime event: click Add ⇒ double click [ObjectName].OffsetTime
    • Set Task
      • Name: (Choose a Task), click on ... then double click on USBParMarker
      • Select Action: WriteByte
    • Set Parameter:
      • Source: (custom)
      • Custom: 0 (if you want the marker value to reset to 0 at the offset of the object)
      • Data Type: Integer
      • Enabled: Yes
  • Optional for both Task Events: set Delay. This will introduce a delay relative to the Event (e.g. the OnsetTime). For example, when an OnsetTime Event is added and the Delay is set to 100, the Task will be performed 100 ms after the OnsetTime of the concerning object. To avoid confusion, it is advised to leave the Delay at 0 and always send markers at the OnsetTime of objects, and set it back to 0 at the OffsetTime of objects.
  • When using Task Events to send markers, make sure that the PreRelease of the object is set to 0. The PreRelease can be set in the Durations/Input tab in the Properties of the object.

Important

  • Always use the same USB port for the cable. When you use a different port, the COM port number will be different.
  • E-Prime crash. When the port number is not set correctly or when the USBParMarker is not connected to the PC, E-Prime will crash (error message: "an error occurred while attempting to open the device").
  • PreRelease with Task Events. When using Task Events to send markers, make sure that the PreRelease of the object is set to 0. The PreRelease can be set in the Durations/Input tab in the Properties of the object.
  • Make sure that the duration of the marker is at least a few samples. For example when recording physiological signals with Biopac at a sampling rate of 500 Hz (500 samples per second), each sample has a duration of 2 ms. In this case, when sending a marker with a duration of 1 ms, it is possible that it will be missed by the Biopac. In this case, we would advise to send a marker with a duration of at least 10 ms. Always check that all markers are present in your data.
  • Reset marker value. Always include an inline at the start of your experiment in which you reset the marker value.
Tags: