Sending triggers from e-prime 3 to BrainVision using a serial port

297 views
Skip to first unread message

ronis...@gmail.com

unread,
Apr 21, 2022, 1:20:14 PM4/21/22
to E-Prime
Hi,

We have an EEG study and we want to sent numerical triggers from e-prime to BrainVision via a trigger box (currently recognized as COM4) at the onset of several events. We added the serial port as a device to the experiment object properties but we are unable to sent the actual numeric triggers (we tried both TaskEvents and inlines with "WriteInteger," but no success).

We would appreciate any help.

Thanks!
Roni




David McFarlane

unread,
Apr 21, 2022, 2:02:39 PM4/21/22
to e-p...@googlegroups.com
Roni,

I would divide this problem into two aspects:

(1) Getting E-Prime to output a signal through the COM trigger box.

(2) Getting BrainVision to recognize an input signal.

Otherwise, I cannot tell whether failure comes from a failure of (1) or
a failure of (2) (we call this overall development/troubleshooting
strategy "divide and conquer").

For (1), I would just put something like a voltmeter or oscilloscope at
the output of the trigger box and use that to see if I can get E-Prime
to produce an output. Pay attention to the documentation that came with
the trigger box and parameters such as COM Port number, Bits per second,
Data bits, Parity, and Stop Bits. (Actually, I might take a step back
first and check in Windows Task Manager to make sure that Windows sees
the trigger box as a working COM device with a working driver.) Note
that some COM-to-digital devices require special commands to get an
output, not just Serial.WriteByte or Serial.WriteInteger -- e.g., the
USB-TTL module from Black Box Toolkit requires a different set of
commands, so you must follow the procedure in their documentation.
Also, start by using a command that should affect *all* of the output
lines from the trigger box, e.g., Serial.WriteByte, that way you do not
have to worry about which output line to connect to at this early
testing stage.

For (2), I would use something like a battery to provide a known good
input to BrainVision. Assuming that it wants a TTL level input I would
use a pair of 1.5V batteries in series to provide 3V.

Once I had confidence that both (1) and (2) work I would then proceed to
mating E-Prime & the COM trigger box to BrainVision. And at this point
I would have to look out for one particular "gotcha", make sure to leave
your trigger signal in place long enough for the BrainVision to
recognize it, and then reset the output to 0 before outputting another
trigger signal!

Hope that helps.
-- David McFarlane

Roni Shafir

unread,
Apr 25, 2022, 1:01:39 PM4/25/22
to E-Prime
Hi david,

Thanks for your detailed response! This was very helpful, we managed to send the triggers using WriteByte in TaskEvents.

Thanks,
Roni

 

--
You received this message because you are subscribed to a topic in the Google Groups "E-Prime" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/e-prime/XKSMMpMj3Gc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to e-prime+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/32ec2a5a-10d4-4345-c410-bceb4f4751a4%40msu.edu.
Reply all
Reply to author
Forward
0 new messages