Sending TTL through Parallel Port

550 views
Skip to first unread message

Adam Hakim

unread,
Oct 7, 2015, 9:26:14 AM10/7/15
to psychopy-users


Hi,
I've been googling and tinkering for many hours, in an attempt to allow my script to send a simple signal to our physiological monitoring device, but have failed so far. 

Here is the basic script:
from psychopy import parallel
port = parallel.ParallelPort(address=u'0xB010')

The error:
AttributeError: 'module' object has no attribute 'ParallelPort'

Tried these scripts also:
from psychopy import parallel
parallel.PParallelInpOut32
parallel.PParallelDLPortIO

and got similar errors:
AttributeError: 'module' object has no attribute 'PParallelInpOut32'
AttributeError: 'module' object has no attribute 'PParallelDLPortIO'

then tried this:
from psychopy import parallel
parallel.setPortAddress(address=0xB010)
parallel.setData(2)

and the following error occured:
Traceback (most recent call last):
  File "C:\Users\intlab\Desktop\EMG stimuli\ttl_testing.py", line 11, in <module>
    parallel.setData(2)
  File "C:\Program Files (x86)\PsychoPy2\lib\site-packages\psychopy-1.82.01-py2.7.egg\psychopy\parallel\__init__.py", line 151, in setData
    raise RuntimeError('Port address must be set using setPortAddress')
RuntimeError: Port address must be set using setPortAddress


I'm using Windows 7 - 64 bit. and know that it is troublesome OS for this function.
My parallel port is "PCIe to Multimode Parallel Port (LTP1)", and it's address is 'B010'.

I used a software called "Inquisit 4", that can send simple TTL signals, and the signal was indeed detected on our monitoring device using AcqKnowledge software . This implies that the port, drivers and wiring are working correctly.

I tried reinstalling the InpOut32 drivers presented in the following link:
Clicked the InstallDriver.exe, and moved files inpout32.h, inpoutx64.dll, inpoutx64.lib, all to the System32 directory, and to the directory where my script is.
I gave my user admin-permissions to these files, and also to the parport.sys file in System32/drivers.

I read through both these topics:

and as detailed, have attempted their suggestions without success.

Our experiment is due to run next week, and everything is set apart from this TTL output. Will be very grateful for any assistance or further suggestions.

Kind Regards,
Adam

Jonathan Peirce

unread,
Oct 12, 2015, 6:51:46 AM10/12/15
to psychop...@googlegroups.com
I think you're running into issues with 64/32 bit clashes.

On 07/10/2015 14:24, Adam Hakim wrote:
>
> and got similar errors:
> AttributeError: 'module' object has no attribute 'PParallelInpOut32'
> AttributeError: 'module' object has no attribute 'PParallelDLPortIO'
These errors suggest that the working driver hasn't yet been found
> I tried reinstalling the InpOut32 drivers presented in the following link:
> http://www.highrez.co.uk/Downloads/InpOut32/
> Clicked the InstallDriver.exe, and moved files inpout32.h,
> inpoutx64.dll, inpoutx64.lib, all to the System32 directory, and to
> the directory where my script is.
You only need the dll file but you need to use the 32bit version of the
driver, not 64bit, becuase the python windows installation we're
currenlty providing is 32bit (assuming you're using Standalone). Also,
in this case, you need to put the 32bit dll file into the folder
Windows/SysWoW64. Bizarrely, this is a folder for 32bit drivers under
64bit Windows.

hope that helps
Jon

--
Jonathan Peirce
Nottingham Visual Neuroscience

http://www.peirce.org.uk





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.

Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.

This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.

Reply all
Reply to author
Forward
0 new messages