1

I need to send some data via parallel port using Python. And for this I am using psychopy.parallel module.

I have two Windows 7 x64 machines connected via parallel port. This connection is tested and working because it is used by another software to send data via LPT1 port.

I have installed the necessary libraries for psychopy.parallel as described here.

Here is my naive intuition:

Machine 1 (Sending data):

from psychopy import parallel
port = parallel.ParallelPort(address="0xC010")
port.setData(3) # sets just pin 2, 3 high

Checking on Machine 1

port.readData()
> 3

Checking on Machine 2 (Receiving data):

from psychopy import prallel
port = parallel.ParallelPort(address="0xEC00")
port.readData()
> 0 

I see that although I can set the pins correctly on Machine 1 and read the result, Machine 2 just gives me a 0.

  • How to send and receive a signal via parallel port correctly?
6
  • 1
    Just as an alternative, any reason you can't just use TCP/IP? Commented Jun 24, 2016 at 14:30
  • What is received if you send 255? Commented Jun 24, 2016 at 14:36
  • Also try github.com/pyserial/pyparallel Commented Jun 24, 2016 at 14:38
  • 1. Unfortunately I have to use parallel port for LPT1 debugging. 2. If I send 255, the output of port.readData() does not change, it is still 255. 3. pyparallel does not work on Windows x64 Commented Jun 24, 2016 at 15:51
  • 1
    @handle The psychopy.parallel package is essentially pyparallel but with a couple of additional convenience functions Commented Jun 27, 2016 at 9:44

1 Answer 1

1

There are a few options:

  • Maybe you haven't got the right driver for pyparallel/psychopy to talk to. You'll need a 32bit parallel port driver if you're using the Standalone PsychoPy (which includes 32bit python). The answer in the link below tells you how to download another test utility that will insert the correct version of both 32bit and 64bit drivers, which you need to do on both machines obviously
  • your script sending the pules will finish immediately and conceivably the pins are all being set back to low when the script ends? (I think this isn't usually the case but worth checking)
  • have you set the right address for the parallel port? Your code currently uses the default address but there are various options.
  • Lastly, the link below tells you how to do it using inpout32.dll directly but I think the drivers are the first thing to get fixed

PsychoPy sending triggers on 64bit OS

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for the links, I have updated my question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.