psychopy.org | Reference | Downloads | Github

EEG missing triggers

Hi all,

We are having a bit of trouble with sending triggers to the EEG recorder. We are using psychopy 1.83.4

On each trial we show 5 images, the first 2 are pre-masks and the last 2 are post-masks which are followed by the participant response

We want to send the trigger during the presentation of the 3rd image (which is the target) and also during the response. The problem is that were are missing a lot of triggers for the target image.

Please find the script attached. Could you please take a look? Below I put some notes to localise the relevant bits of code, Any comments would be much appreciated.

Note that regarding the trigger for the target image onset, we use this function in line 421

def sendCode(code,dur):
parallel.setData(code)
core.wait(dur)
parallel.setData(0)

in combination with: win.callOnFlip(sendCode, int(temp_correctAns),0.001) # in line 431

Later in line 671 we send the triggers for the response

if response.keys == "1":
    trigger_code = 3
elif response.keys == "2":
    trigger_code = 4

parallel.setData( int(trigger_code))
win.logOnFlip(level=logging.EXP,msg="rep trigger {}".format(int(trigger_code)))
core.wait(0.01)
parallel.setData(int(0))

Many thanks

DavidExpEEG_pilot.py (38.7 KB)

If you’re only occasionally dropping triggers, the first thing I’d suggest would be to extend the amount of time you leave the pins “on”. At the moment you’re only leaving them up for one millisecond. I assume you’re recording at 1000 Hz, so maybe extend it out to something like 4 ms or so just to be safe?

2 Likes

hi, actually for the trigger associated with the response we used 0.01, while for the target image it was set to 0.001 - thanks for spotting this. we’ll try it your suggestion of 0.004 or even 0.01 for all triggers.

best

david

1 Like