EEG Experiment with ParallelPort to Send Triggers

For some reasons, the ParallelPort of my EEG does not connect with PsychoPy, and I am not sure why it cannot connect…

OS : win7
PsychoPy version 3.0.7 :
Standard Standalone? Yes
What are you trying to achieve?: I am trying to connect the LPT Port with PsychoPy to generate triggers, but whenever I try to run the experiment, it keeps showing me the error message

Port1=parallel.ParallelPort(address=‘0x2007’)
TypeError: ‘NoneType’ object is not callable

I am using Polymate Pro V, and the IP of my port is 0x2007

3 Likes

Hello. May I ask if it has been solved now

Hi @Leo1,

Are you facing a similar problem to the original post? Are you using the parallel port component or a code component?

Thanks,

Kim

Hey! we are usign Gtec and psychopy for the integration and we are facing very similar issue in the process. Its like the entire experiment is setup but we are not able to see anything run after setting up the trigger, any sort of help would be appreciated.

Hello @Yashpreet_Kaur

Do you see the EEG-signal? How do you send the trigger to the recording PC?

Best wishes Jens

1 Like

Hey! no, we are trying to dry run the experiment that’s primarily because we are not seeing the signal but the deal is During the process of dry run after showing the instruction screen and fixation cross the screen goes absolutely blank. (this is post setting up the triggers, port address, everything). Would you know why?

Hello @Yashpreet_Kaur

Which screen goes blank? The PC running PsychoPy or the recording PC?

Best wishes Jens

1 Like

Yes! the PC running Psychopy shows the screen going blank.

(When we run the experiment without the parallel port trigger the experiment runs perfectly only when the parallel port components are added it gets stuck after the first fixation cross). Should i attach the experiment file here for your reference so that you could help us with where we are going wrong?

emphasized text
EmotionEEG.psyexp (146.9 KB)
Here is the experiment file for your reference.

In the parallel port component that you have in your blank routine, could you try changing the start condition to:

text_3.status == STARTED (instead of blank.status == STARTED)

And the one in your probe routine to:

text_4.status == STARTED (instead of probe.status == STARTED)

1 Like

Noted, i will try doing that. But could you possibly explain the reason for change?

Also i wanted to understand a couple of things, since this is my first time creating a psychopy experiment:

  1. If there can be multiple triggers added to one trial?
  2. We did not put the g.tec eeg machine on while running the dry run of this experiment since it was intended to be the dry run, that’s not the issue to why the experiment is not functional right?

The reason for the change is that the .status attribute is added to components rather than routines. So checking routine_name.status == STARTED would not ever actually return True and therefore never send the trigger. This would prevent your experiment from moving on, likely causing the hanging issue you encountered. As for your other questions, though:

  1. There can be multiple triggers in one trial yes, but do bear in mind that it is not recommended to try to send multiple triggers at the same time to the same address. If two parallel port components are set to send triggers at the same time, they may interfere with each other, and only one trigger may be sent—or neither correctly.
  2. Ah - yes that may indeed cause an error and could be part of the reason that the experiment won’t run fully. As you’ve added parallel port components set up to attempt to communicate with a device at a given port address, if that device is not connected then an error is very likely to occur. Any errors you do encounter will appear in the stdout panel of the Runner window. It would be helpful if you could copy and paste any errors you’re seeing as that will help to pinpoint the cause of your issue.

Hope that helps!

Kim

Hello! Thank you for the suggestion!
I have deployed the suggested changes although the experiment is still not working


That’s the screenshot of window where experiment gets stuck at the ‘prime face trial’. Please help me sort this! Is it possible to arrange for a quick Google meet with you to look into this particular concern?



So here is a screenshot of the port we used, configured from device manager of our system and also the inpoutx64.dll that we have in our Pyschopy experiment setup folder, would you be able to let us know if there is anything wrong with this part?

Do you have your EEG connected now?

What happens if you change all of the parallel port start fields to time(s) and set the time to 0? If this solves the freezing issue then you’ll know that the problem lies with the start conditions.

If you’re just wanting to send a different trigger value for the left and right images by the way, you can handle that by setting the trigger value in your conditions file, rather than having two parallel port components. It might also help you to troubleshoot if you remove one of those from the prime face trial routine.

Hey! the experiment ran fine with implementing the first part, thank you for that. We did not have to yet use the second part, do you think we should still consider removing one of those triggers from prime face trial routine. Also, we had a fresh doubt which is the output excel we get as the experiment successfully runs, do you think this is accurate? We do not see any trigger onset columns yet, do we have to manually set them in order for them to appear in the output sheet, or once we connect our G.tec EEG system with Psychopy, Do you think then the output sheet would be different from the current one? I am attaching the output excel with this message. (P.s: this excel is from dry run of some trials in the run)
yashu2_untitled_2025-04-25_11h45.21.684 (1).csv (5.7 KB)

If you’ve still not connected the EEG system whilst testing any of this I would strongly recommend that you do so and post an update following that. It is not ideal to send your triggers on a start time (see our documentation here), this was done only to see if the freezing issue was with those start conditions. However, as the triggers can never actually send if there is no EEG connected, we still can’t be sure if the problem is because of that or the start conditions being incorrect.

As for having the two parallel port components in one routine, yes I would recommend that you instead set the trigger value in your conditions file rather than having two separate components. You would have a column in your conditions file called trigger_val for example and then enter the values you want to send for each image. Then, in the start data field of your parallel port component you’d enter the trigger_val column header name.

1 Like

Hello @Yashpreet_Kaur

Tthe freeezing seems to be related to the parallel port-component. When I disable all parallel port-components I come to the welcome screen and may press ‘space’. The experiment ends there because I do not have the condition file or the stimuli. So, as @Kimberley_Dundas suggests attach your EEG-system and make the start of a parallel port-component either dependent on the start of another component in the same routine or give it a fixed start time.

BTW, it does not really make sense to Sync the parallel port-component with the screen refresh. You want to send the parallel port trigger as fast as possible and as close to relevant stimulus as possible. YOu might introduce a delay by adding Sync with screen refresh.

If possible for you, measure with a photo-diode the onset of the visual stimulus. Feed this with the parallel port trigger to an osciloscop to determine any lag in your system.

Best wishes Jens

2 Likes

Hey! Noted, we are in the process of connecting EEGand we will soon send in an update on the cause behind freezing issue. Although i wanted to reiterate our present paradigm and the number of triggers we want to set up in the process of the experiment. 1. beginning of welcome screen 2. another trigger when participant continues reading the Instruction on welcome screen 3. Pressing space 4. fixation cross 5. beginning of prime face 6. Prime face (here we needed two simultaneous trigger components to be set up on one side we are presenting absolute image (sayleftside) and on the other side of fixation cross we are presenting scrambled image (sayrightside) which would hold similar presentation time which is 150ms) so our paradigm required us to do so. But based on your recommendation so far, i am a little confused about how setting up one trigger component for left_image and right_image presented at the same time for the same duration be helped? Also we have added different trigger numbers for different emotions presented in the excel for both left and right image in two columns namely (right_trig) (left_trig), I know this could be a little basic for you or some of the arrangements for setting up the trigger may be not very accurate but this is my first time setting up an EEG experiment soo any help and clarity on those points could be greatly helpful. Continuing, 7. blank interval 8. probe word correct 9. Probe word incorrect (also the probe words are disgust, fear, surpise so that we will set up triggers for that too) 10. End of the trial.

Thank you so much already!!!

Noted! we have made the required adjustment by unticking the sync with screen refresh. Also about the Photo-diode measurement, we are not very sure about the method of it, I will read on it and try doing so soon!