I/O Operation on closed file

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 2024.2.4 Py 3.8): 2024.2.4
Standard Standalone Installation? (y/n) If not then what?: Y
Do you want it to also run online? (y/n) N
What are you trying to achieve?:
I’m working on an eye-tracking experiment in PsychoPy Builder (v2024.2.4) using an EyeLink 1000 Plus. I’ve successfully set up the EyeLink integration using the SR Research PsychoPy EyeLink plugin. All necessary files and components (Developer’s Kit, EyeLink plugin components like Initialise Connection, Start Recording, etc.) are installed and working properly - the experiment runs, records eye data, and saves everything as expected.

I needed to implement a fixation tolerance zone around a central fixation cross.

  • If the participant’s gaze moves outside this area while the fixation cross is visible, the trial should be aborted immediately, ideally with a warning message/image such as “BROKEN FIXATION - LOOK AT THE SCREEN CENTRE” or something.
  • That trial should then be recycled back into the trial loop (so I always end up with 90 successful trials).
  • Once the fixation cross disappears, the gaze restriction should end and participants are free to make saccades.

THE PROBLEM:
So, when I added a GazeTrigger component and some code to set it up as a fixation tolerance zone, similar to EyeLinkFixationWindowFastSamples_Plugin example, after 1 trial the experiment crashes and quits with the attached error message.

No matter what i do to try fix it, nothing works. It was running perfectly before the GazeTrigger and code additions. Any help? Here are my code chunks and components incase someone can spot something that I simply cannot spot.