Sending triggers via parallel port to eego software

OS (e.g. Win10): Win 7
PsychoPy version (e.g. 1.84.x): PsychoPy2
**Standard Standalone? y
**What are you trying to achieve?:

First of all, thanks in advance and apologies for bringing up a common issue again but I’ve been searching for answers all day and not been able to solve this issue.

I’m trying to get PsychoPy to send triggers to the eego EEG software to see when certain images are displayed.

I’ve followed threads such as this: Cannot send a signal via ParallelPort using PsychoPy on Windows7 (64bit)

and have managed to get the PC I’m running the experiment on to recognise the parallel port and run the test experiment successfully without any error messages. The issue I’ve found is there are no visible triggers on my eego preview.

I really just want to get the parallel port to log different data triggers when different stimuli are shown. In this test example, 2 when a wolf is shown, 3 when a tsunami is shown etc. then set the data point back to 0 when the trial ends, and repeat this process for the next trial etc.

What did you try to make it work?:

I tried using the parallel port out component in builder view and it looks like this:

From what I can tell the port address is correct, and the “Start data” field aligns with my conditions file and looks like this:


I’ve also tried following a similar method in this thread by using code: Very lost on how to get a trigger sent using parallel port

And here’s how my code looks:

Begin Experiment:

from psychopy import parallel
port = parallel.ParallelPort(address = 0x0378)

Each Frame:

if images == ‘images/wolf.jpg’:

if images == ‘images/tsunami.jpg’:

if images == ‘images/tornado.png’:

if images == ‘images/tiger.jpg’:

End routine:


However had the same issue. Here’s an example of some code I used and I’m not 100% sure the syntax is correct but as I say I’ve had no error messages, just no visible triggers. I realise the code I’ve used was experiencing problems anyway but wondered if this was down to the use of a PP component.

I tried both ways together, and separately, and couldn’t see any triggers occurring in my eego program.

I’m wondering if the issue lies in how either the PP or code components are set up, or if the issue is to do with something else? I’m also wondering if this problem might be circumvented with a newer version of PsychoPy (although as a PhD student on an isolated university PC this isn’t something I have free control over at this time).

Any help is greatly appreciated.

I should also specify two other factors:

  1. The experiment is run on one PC and the EEG software on another. They’re connected by a USB parallel port (I believe).

  2. The experimental PC also has e-prime which can send the triggers using the same port address, and is picked up by the eego software.

Hi There,

Before making any further suggestions - is there a readon your team are using PsychoPy2 rather than updating to a newer version? There are lots of nice improvements in more recent releases!


Hi Becca, thanks for your reply.

There’s no good reason we’re using PsychoPy2, and I’m currently in the process of trying to get this updated. Annoyingly some of my attempts to fix this issue are a bit hamstrung by my limited access to the admin rights on the PC we’re using, but I’m hoping this issue will be resolved in the next few days.

I’m mainly wondering if before I am able to change other drivers/settings on the PC I don’t have access to just yet, if there’s something I need to change either with the code or the builder component I’ve outlined in my original post

Thanks again

Hi there - two thoughts:

  1. I’m not quite sure if this also applies to your setup, but as per this advice, you should beware of USB-parallel-port connections. Am I correct that, based on your explanation, your stimulus computer is outputting via parallel port into the eego EEG software, which has USB input? If so, then @habboud’s warning in that post about timing precision may apply.
  2. If the EEG system is never seeing a value, are you sure that any of the if statements ever evaluate to true? Is images definitely the variable name that holds the image string? Just something to check.

@jtseng The eego does accept TTL input. Due to its small size, a small connector is used. ANT Neuro makes a cable that converts from a commonly used DB25 connector to their small connector.

I don’t know if the eego accepts USB input.

i’ll be going back into the lab tomorrow so will try some of these suggestions then, thanks for your help.

if there’s no obvious issue anyone can see with what i’ve posted then perhaps it is just a question of tweaking things here and there until it works! i’ll update this post with any news of success/failure!

Hi @Ral,

Apologies for the questions, but can I just clarify the following so I can help as best I can:

  1. You say you have tried these solutions separately and together. When you try the version with the code component, are you firstly removing the parallel port component from your routine?
  2. For the Builder only version of your issue (with the PP component only and no code component), how long is each trial? Also how does the trial come to an end - is it automatic or controlled by the participant?
  3. For the version with the code component only, what is the actual image component in your trials routine called? Is this also called images in the same way as the column header in your conditions file?



1 Like

hi @Kimberley_Dundas !

To answer your questions:

1 & 2 - I’ve tried running this with only the code component, without a PP component, and I’ve also tried this the other way round, so only the PP component and no code.

2 - The trial lasts indefinitely until the participant presses a button. I’ve also tried the trials with a timed structure, for instance the participant has 5 seconds to press a response.

3 - I’d need to double check this tomorrow morning when I’m back in the lab but I’m quite sure I made sure the image component was named either “images” or “image” and tried using both of these in my code, mainly because I wasn’t sure which of these the code was searching for and wanted to check this.

I hope this helps in the meantime but I can confirm my answer to question 3 tomorrow.

Thanks for your help it’s much appreciated!

Great, thanks!

With the Builder-only version, can you try:

  1. Making sure that the image component is right at the top of your component list in your trials routine (to do this just right click on the image component name and select ‘move to top’).

  2. Reducing the duration of the PP component firstly to something like 0.2s to see if this sends a trigger. I’m wondering whether the trial could end before the 5s trigger duration is over, which may have weird effects as the value will never reset to 0. If this sends a trigger we can set it to end when the participant makes their response, but for now let’s just see if that’s the problem.

  3. I know you mentioned that ePrime picks up the triggers using this PP address but I just want to double check the issue isn’t to do with the address, as you mentioned a USB connection. Just try the above 2 suggestions with the port address you’re using already, and then again with each of the USB options that I believe were still in the Port address drop down in PsychoPy2 (they should be ‘LabJack U3’ and ‘USB2TTL8’). Just to be certain that this isn’t the issue before we try other things.

Thanks again!

Hi Kim

Thanks for your reply.

I’ve now tried each of these ideas and still don’t see the triggers in the eego software. I re-ran an experiment on e-Prime just to double check it works there and the triggers appeared.

For point 3, I didn’t have the second address you mentioned but the LabJack U3 address returned the error: “No module named u3”.

I tried compiling the experiment to script to see if the port component was acting as I would expect and from what I can tell it seems to be referencing the column in my conditions file (shown in my first post) correctly, however nothing seems to be happening?

    # *port* updates
    if t >= 0 and port.status == NOT_STARTED:
        # keep track of start time/frame for later
        port.tStart = t
        port.frameNStart = frameN  # exact frame index
        port.status = STARTED
        win.callOnFlip(port.setData, int(conditionStart))
    frameRemains = 0 + 0.2- win.monitorFramePeriod * 0.75  # most of one frame period left
    if port.status == STARTED and t >= frameRemains:
        port.status = STOPPED
        win.callOnFlip(port.setData, int(0))

Thanks again for your help

Thanks for trying those out @Ral,

I have two more things for you to try, as I can’t see a problem with your set up from what you’ve kindly provided here. But the first one will involve you downloading and installing a .dll file on the machine running PsychoPy, so you will need access to the admin rights on that machine.

  1. Download and install the InpOutx64.dll file from here. You need to use the “Binaries only - x86 & x64 DLLs and libs” option under the Download Links subheading.

You then need to put the InpOutx64.dll in the same folder as your PsychoPy experiment file. Then restart PsychoPy and try running your experiment again. You can get a more detailed explanation on this post.

  1. Step 1 might solve your problem, but if not (or in the meantime whilst you wait for admin rights) then we need to find out more about the parallel port. To do this, there is a demo in the Coder view which will help. I know this demo exists in PsychoPy3, so I’m hoping it also exists in PsychoPy2! To run the demo, open Coder view > demos > hardware > If you run this and there’s an error, please paste that error here.

I hope this makes sense, do let me know if anything needs clarifying!


hi @Kimberley_Dundas

I’ve now got back into the lab and tried both suggestions you made. I tried running the demo for the parallel port both before and after updating the driver from 32 to 64bit and both times got this error message:

Welcome to PsychoPy2!
Problem compiling: [Errno 13] Permission denied: ‘C:\Program Files\PsychoPy2\lib\site-packages\psychopy\demos\coder\hardware\parallelPortOutput.pyc’

Running: C:\Program Files\PsychoPy2\lib\site-packages\psychopy\demos\coder\hardware\

1.6276 WARNING psychopy.parallel has been imported but no parallel port driver found. Install either inpout32 or dlportio
1.6276 WARNING Could not initiate port: global name ‘ParallelPort’ is not defined
1.6278 WARNING Monitor specification not found. Creating a temporary one…
2.5454 WARNING Couldn’t measure a consistent frame rate.

  • Is your graphics card set to sync to vertical blank?
  • Are you running other processes on your computer?

Traceback (most recent call last):
File “C:\Program Files\PsychoPy2\lib\site-packages\psychopy\demos\coder\hardware\”, line 32, in
parallel.setData(0) # sets all pins low
File “C:\Program Files\PsychoPy2\lib\site-packages\psychopy\”, line 165, in setData
raise RuntimeError(‘Port address must be set using setPortAddress’)
RuntimeError: Port address must be set using setPortAddress

The first real line of the error message seems to suggest to me PsychoPy doesn’t even have access to the demos for the parallel port? In which case perhaps admin rights is the real crux of the issue here? But perhaps you can advise on this.

Many thanks again

Thanks so much @Ral. I have more steps, we will get this sorted!

  1. Apologies for the repetition but is the inpout32/inpout64 file in the same folder as your experiment (rather than in the same folder as PychoPy itself)? There is certainly an issue with PsychoPy’s access to the driver, potentially because it’s located in the Program Files which are likely to be protected by admin rights, rather than in your user space. Can you put both drivers (32 and 64) in the same folder as your experiment file just to be on the safe side? Then try your experiment again, not the demo. If it works now, great, if not move onto the next step.

  2. It looks as though, because the demos are only currently located in Program Files, PsychoPy can’t access those, you are totally right. In Builder view, if you click on the Demos tab there, do you see an option to ‘Unpack demos’? If you do, select that and choose/create a folder that is in your own user space. Then try running the demo again, and any error message (or any message at all) please again paste here.

Thanks so much!


Hi @Kimberley_Dundas

Yes, both the 32 and 64 file are in the same folder as my experiment. I had an earlier issue before all this where the parallel port input wasn’t working at all (throwing up some kind of error message) but I solved this by installing the 32bit .dll file and having this in my experiment folder too. The issue now seems to be that even though it can ‘see’ the parallel port, it’s not able to see any data sent from it? I’m not very experienced in this side of things though so is a bit of a guess.

I’ve tried unpacking the demos in builder view, but didn’t have the option of the parallel port demo via hardware, these were the only visible options:

Many thanks

Thanks again so much for trying out these steps. So, I’m asking this as someone else as just had this exact issue and this is how we solved it! Can you please make sure that:

  1. You have the driver files in your experiment folder exactly as this person does, so the 3 inpout files that you can see here. Note that the .dll and . lib files are x64 and the .h file is the 32 (screen shot from this post):

2. Go to Device Manager > Ports > Find your parallel port from the drop down > Right-click Properties > Resources tab. Can you please send a screen shot of what you find here?

Thank you so much for your patience with this.

Thanks again,


Hi @Kimberley_Dundas

Apologies for the late reply, I’ve only just managed to get back in the lab.

I’ve double checked the layout of the experiment folder. There doesn’t seem to be any issues, however when trying to use the inpout64.dll file the experiment just won’t run. It seems I have to have the 32bit version installed instead and it works fine?

I’ve been to the resources for the pport in device manager too, and here’s what I find:

Many thanks for your continued help on this!

Ah, apologies. I assumed you wouldn’t be able to install the 32 bit .dll without admin rights (as I believe the installer requests admin permission), but if that’s installed and working then good. The thing that’s odd is that your error message from before still points to an issue with the driver.

Thanks for checking the ports. The address is certainly correct which again leaves only the driver. To be doubly certain about this, could you just send a screenshot of the contents of your experiment folder? If all is well here I can talk to other members of the team to shed some light on the issue. However, I really would recommend upgrading to PsychoPy 3 if you’re able to as there are lots of improvements and bug fixes in newer versions.

Thanks for your patience,


Hi Kim

Strangely installing the 32bit .dll is one of the few things the PC will allow me to do with my current level of permissions.

Here’s the contents of my experiment folder:

If this can’t be solved through any tweaks within the folder or PsychoPy itself, and if everything appears to be working I might just have to chalk this up to a permissions issue I think? If so I’ll have to think of ways to circumvent this issue altogether but at this point this is probably more achievable!

Thanks again for your help

This is going to sound ridiculous, but as a last ditch attempt can you please try:

  1. Renaming the inpout32.dll file so that it’s all lower case (as I’ve written it here)
  2. Finding the inpout32.lib file from the extracted folder and also placing it in this folder.

In the meantime I’ll ask the rest of the team to check there’s nothing obvious I’m missing!