How can I send triggers using inline code in E-Prime to ActiveTwo using the Biosemi USB Virtual Serial Port cable?

Posted by & filed under .

Biosemi delivers a USB virtual serial port trigger cable with each new Biosemi ActiveTwo system. Sending triggers via this cable involves sending a byte containing a value between 1 and 255 via the virtual serial port (COM port) that is setup by the driver installation. See this page at the Biosemi website:

for instructions on how to install and configure the cable. The linked page also explains the recommended method of sending events in E-Prime 2.X and 3.X, which is to use Task Events.

If your E-Prime experiment contains legacy inline code for sending triggers via the parallel port, you can switch to sending triggers via the new USB virtual serial port cable by following these instructions:

  • Be sure that the USB virtual serial port driver is installed and the baud rate and other parameters are configured within Windows Device Manager. Baud rate MUST be set to 115200, data bits = 8, parity = none, stop bits = 1.
  • Note the COM port number assigned by Windows, because you need this to setup the port in E-Prime.
  • Add the Serial device to your experiment using the Devices tab of the Experiment Object’s property pages.
  • Specify port settings for the Serial Device directly on the Experiment Object. Baud rate MUST be set to 115200, data bits = 8, parity = none, stop bits = 1, and the correct COM port number must be selected.
  • Use E-Basic script within an InLine for communication with the serial port.
  • Assuming you leave the device name as the default value “Serial”, the inline code to write trigger code 255 to  the virtual serial port would be:

Serial.WriteBytes 255

  • Of course, the value to be sent can also come from a field in an E-Prime List Object properly referenced in place of the value 255 in the above line of code.
  • It is unnecessary to reset the port to zero after a short delay with the USB Virtual Serial Port trigger cable, because the electronics in the cable automatically reset to zero after holding a non-zero code on the port fort eight milliseconds.