serial port communication issues
Dear Community,
We are setting a new EEG system (Brain Products Actichamp +64 channels and Triggerbox, using a serial port) with stimulus presentation on OPensesame 3.3.14. All the trigger ports are working properly and the two computer are communicating as well. Our problem is that, when we are using Opensesame, we can only send the first trigger but then no other triggers are sent after the first one. We have already checked all the recent forum posts on trigger issues and applied some of the suggested solutions but still we have the problem.
If we run the code inline below before or after a stimulus sketchpad that repeats within a loop, sometimes we get one single trigger sent just once, sometimes it sends triggers in the first 4 event repetitions and then never again. Here is the code:
ON PREPARE:
import serial
import time
serial_port = serial.Serial('COM7')
trigger_code = 20
trigger_byte = bytes(chr(trigger_code), 'utf-8')
ON RUN:
serial_port.write(trigger_byte) time.sleep(0.02)
Does anyone here has experience in setting serial ports? As I said, when we run the Brain Products trigger box tester outside Open Sesame, all triggers work and the computer communicates just fine.
Comments
Hi @mattia ,
My first thought is that the recording device may respond to changes in the trigger value, rather than to the triggers as such. If so, then you need explicitly reset the trigger back to 0 (or some other value) after each trigger is sent, like so:
Does that resolve the issue?
— Sebastiaan
Check out SigmundAI.eu for our OpenSesame AI assistant!