Trigger generation issue

Dear Community,

Info:
Psychtoolbox-3 (3.0.19)
MATLAB platform (2021b)
ubuntu (22.04)

I have a very broad question. I am running my experiment and pass the triggers on EEG. However, sometimes random triggers are missing, around 50 out of 2000+. I was not able to figure any pattern in the way they fail to being recorded. They are triggers with different codes too, which are present on most cases, but then accidentally drop out. This issue is pretty annoying, since it takes time to recover them and I still loose some of my trials.

Here is the port setup code snippet:

% Set up serial port 
portParams = 'BaudRate=115200 DTR=1 Terminator=10';
com = '/dev/ttyACM0'; %COM port for serial connection
SerPort = IOPort('OpenSerialPort', com, portParams);    % Get handle for serial port

Here’s how I pass the triggers:
IOPort('Write', SerPort, ['WRITE 13 1000 0' char(10)]);

I am now trying to figure out what causes this problem: PTB, trigger port or the EEG recording software (eego, ANT). Are there any reasons the triggers may accidentally not be going through due to the PTB settings?

I will be grateful for any piece of advice!
Please let me know if you need further details.

Best,
Kat

I am experiencing a similar problem with missing random triggers. Did you ever solve your issue?

1 Like

Hey 123,

It was a trigger timing issue. That’s the recommended parameters for passing the trigger:

IOPort('Write', SerPort, ['WRITE 0 5000 0' char(10)])

5000 is the duration of your trigger impulse. I used 1000 instead and it was the threshold value, that’s why I missed random triggers. Luckily, I managed to restore most of them based on the photodiode signal.

If that’s your issue, consult with your IOPort documentation.

I hope it helps!

Best,

Kat