Parallel Port Tester in Python

To test some equipment which was controlled by the printer port on my PC, I wrote a simple test app. This is allows you to control the state of the data bits and control bits and also see the state of the status bits. It’s not very pretty and only does SPP port functions because that is all I needed for the job at hand. I wrote it in Python because I was looking for an excuse to learn wxPython.

Adam's Parallel Port Monitor

Adam's Parallel Port Monitor

Now I am putting it on this blog so anyone else who finds it useful can have it.

To run this, you will need Python obviously, you will also need wxPython and also a DLL called inpout32.dll to allow port access under Windows.

Oh, and it only works in Windows. Sorry.

Download portmon.py here.

4 thoughts on “Parallel Port Tester in Python

  1. Pingback: Adam Pierce » Parallel port control in Python

  2. Adam Dioguardi

    Hi Adam,
    I found your LPT tester while googling a problem that I have with some software that we have inherited to control stepper motors. inpout32.dll keeps throwing an exception when I call it with ctypes.windll from python. I figured I would try your program as well since we are using similar methods, and it gave the same error:

    Traceback (most recent call last):
    File “C:parbufftestportmon.py”, line 126, in
    myframe = MainWindow(None, wx.ID_ANY, ‘Parallel Port Monitor by Adam Pierce ‘)
    File “C:parbufftestportmon.py”, line 73, in __init__
    self.UpdateStatus()
    File “C:parbufftestportmon.py”, line 97, in UpdateStatus
    d = ctypes.windll.inpout32.Inp32(0×379)
    WindowsError: exception: priviledged instruction

    Any ideas? User privileges maybe?

  3. Adam Post author

    Hi Adam, sorry to take so long to reply to your comment, I get so many spam comments that it takes me a while to delete them all and find the genuine posts.

    This is a problem with inpout32.dll, my first thought would be to check that you are running on a 32-bit system. If you have Windows 7, you might try inpoutx64.dll available here:

    http://logix4u.net/index.php

    or just see if there is a newer version of the 32-bit DLL here:

    http://logix4u.net/parallel-port/16-inpout32dll-for-windows-982000ntxp

    I’m sorry that I can’t really diagnose your problem much further than that. The makers of inpout32 know this stuff a lot better than I do.

    Good luck with your project.

  4. Penney

    Hi! I wish to say that this post is amazing, nice written
    and include approximately all vital infos. I would like to look more posts like this .

Comments are closed.