Screen refresh delay in sending parallel port response triggers

Hi Marta,

Apologies I am late to this - I have been on leave. I have been working on this for a while now with help from @Michael and previous similar posts/replies. Response triggers cannot be sent as many times as the response key is pressed / Word by word sentence presentation with parallel port output

I am using a code component in builder - rather than using the parallel port component. I am experiencing 1-2ms delay on triggers including key response - so perhaps yours can be resolved to reduce from the 1 frame currently?

Please note, I am still doing some final testing now so the below is still work in progress but may be of use if you are still experiencing delays with your method.

I have something similar to the following, although i tried to use your variable names to avoid confusion. My keyboard response is set to syn with screen.

good luck!

begin experiment tab

from psychopy import parallel
p_port_prac1b = parallel.ParallelPort(address=0x7F88)

begin routine tab

 # keep track of whether a signal has been sent yet
pulse_sent = False  

# tidy any that may have not been terminated properly
p_port_prac1b.setData(0) 
pulse_terminated = True

Each frame tab

if prac_resp.status == STARTED:
    if prac_resp.keys == 'm' or prac_resp.keys == 'c': #write your condition here - I didn't include any code for the status of the p_port component, only the keyboard response
         response_space.setData(1) 
          logging.log(level=logging.EXP, msg = 1) #print this in the logfile, you check the psychopy logfile timing compared to your output from the EEG marker file
          pulse_start_time = t
          pulse_sent = True
          pulse_terminated = False

# terminate the trigger at least 0.0167 ms (1 frames) later:
if pulse_sent and not pulse_terminated:
    if t - pulse_start_time >= 0.0167:
        p_port_prac1b.setData(0)
        pulse_terminated = True
1 Like