Sending triggers to Parallel Port --> Error Message

2,100 views
Skip to first unread message

Pia Schneider

unread,
Mar 18, 2016, 6:44:05 AM3/18/16
to psychopy-users
Hi,

I'm trying to send trigger pulses to a parallel port.
I have tested the parallel port with presentation and it works.

But with PsychoPy I get the following error message:

p_port = parallel.ParallelPort(address=u‘0x0378‘)

AttributeError: ‘module’ object has no attribute ‘ParallelPort’


I have no idea why I get this error and would be very glad about help.


I used the GUI for the setup of the experiment and can send you pictures if this would be helpful.

Otherwise here are parts of the code that is created by PsychoPy:


# Initialize components for Routine "routine_100ms"

routine_100msClock = core.Clock()

fixationcross = visual.TextStim(win=win, ori=0, name='fixationcross',

    text='+',    font='Arial',

    pos=[0, 0], height=0.1, wrapWidth=None,

    color='white', colorSpace='rgb', opacity=1,

    depth=0.0)

movie = visual.MovieStim3(win=win, name='movie',

    noAudio = False,

    filename='mypath\\beispiel.mp4',

    ori=0, pos=[0, 0], opacity=1,

    depth=-1.0,

    )

p_port = parallel.ParallelPort(address=u'0x0378')


The error occurs in the last line.


If I choose other options form the menu for the parallel port 0x03BC or LabJackU3 I still get error messages.

And as I said I tested the port (0x0378) with presentation and it worked.


I use Windows 7 and PsychoPy Version 1.83.04


I searched for this error message but unfortunately could not find something that helped me.


Thank you very much for suggestions!


Pia


Andre Gouws

unread,
Mar 18, 2016, 10:42:03 AM3/18/16
to psychop...@googlegroups.com
Which parallel module are you importing?

import parallel 

or 
from psychopy import parallel

the second should have the parallel.ParallelPort attribute.

Andre'

--
You received this message because you are subscribed to the Google Groups "psychopy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to psychopy-user...@googlegroups.com.
To post to this group, send email to psychop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/psychopy-users/bc31821a-f9d0-4c25-94de-4c726e3f71dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Byurakn Ishkhanyan

unread,
Mar 18, 2016, 11:16:52 AM3/18/16
to psychopy-users
Hi,

I get the exact same error message with my experiment. Moreover, the experiment works perfectly fine on another computer that is not meant for my experiment. After asking here and there I have been told that I should install inpout32.dll file on the computer. I haven't tried it yet but I'm positive it will be working.

Byurakn

Pia Schneider

unread,
Mar 18, 2016, 2:27:33 PM3/18/16
to psychopy-users
Hi Andre',
I have 
from psychopy import parallel
is that correct?
I have that in the beginning of the script.
Later I have:
p_port = parallel.ParallelPort(address='0x0378')
The adress should be correct, because it works with presentation.
Do I need some other additional code?
(I tried to paste some other code inside but that didn't work.)
Thank you
Pia

Pia Schneider

unread,
Mar 18, 2016, 2:29:07 PM3/18/16
to psychopy-users
Hi Byurakn,
thank you for your tip.
A colleguage has also tested on a different PC and it didn't work there either.
I didn't have a chance to test on the PC where I will have to run the experiment yet, though.
Pia

Byurakn Ishkhanyan

unread,
Mar 31, 2016, 5:12:24 AM3/31/16
to psychopy-users
Hi Pia,

Is your problem solved? I can't find Inpout32 anywhere. All the files that I download seem to have only the one for 64 bit. Is there any other solution to this problem?

Thanks in advance.

Regards,
Byurakn

Daniel Riggs

unread,
Apr 4, 2016, 11:48:21 PM4/4/16
to psychopy-users
I hope this isn't too late for you guys, but Byurakn seems to have been right. I took a look at the source code, fiddled with it, and it turned out it wasn't finding a driver. For some reason, though, I couldn't ever see the log warnings, so I think this is something that should be looked at.

But either way, I found the inpout32.dll file, you just put it in the same folder as your python script and it should work! I'll try attaching it here in a zip file since google won't let me attach it directly. If not it's here on the web page for the awesome program Parallel Port Tester http://www.downtowndougbrown.com/2013/06/parallel-port-tester/  Hope that helps. Hopefully Jeremy or Jon have a comment on why the log warnings don't appear in the console? I'm not too familiar with the logging system.

One last note, Pia, looking at your code and after looking at the source code, I would first try not specifying address. If you do have to specify it, it seems like you won't include quotes around the address (address=0x0378). Take care,

Dan
inpout32.zip

Nayeon Kwon

unread,
Nov 22, 2016, 5:15:21 AM11/22/16
to psychopy-users
I solved this problem with http://www.highrez.co.uk/Downloads/InpOut32/ .
Thanks.




2016년 3월 18일 금요일 오후 7시 44분 5초 UTC+9, Pia Schneider 님의 말:

Mario Reutter

unread,
Nov 23, 2016, 5:05:18 AM11/23/16
to psychopy-users
I recommend this thread to solve problems with triggers and psychopy: http://stackoverflow.com/questions/26762015/psychopy-sending-triggers-on-64bit-os/26889541#26889541

Richard Kirkden

unread,
Apr 5, 2017, 9:47:19 AM4/5/17
to psychopy-users
I found that to solve this problem it was necessary, but not sufficient, to download the inpout32.dll file and save it in the same folder as my PsychoPy experiment. It was also necessary to compile the experiment that I had written in Builder and run it from Coder. The error message persisted if I tried to run the experiment from Builder.

Reply all
Reply to author
Forward
0 new messages