586,075 active members*
4,028 visitors online*
Register for free
Login
IndustryArena Forum > OpenSource CNC Design Center > Coding > C++, Win XP, Parallel Port
Results 1 to 8 of 8
  1. #1
    Join Date
    May 2005
    Posts
    674

    C++, Win XP, Parallel Port

    I'm experimenting with some simple programs in C++ and am trying to figure out how to access the parallel port. Apparently Win XP doesn't allow direct access to the port. Anyone have any pointers on which drivers to use? Thanks.

  2. #2
    Join Date
    May 2005
    Posts
    162
    Hi Zumba,
    I think it's possibly a bit worse than just not allowing direct access, I believe WinXP polls any Parallel ports it can find, if you are connecting something to it that can move real hardware you need to be carefull that you turn this feature off in XP. There's a fix for the polling on this page 'http://www.melabs.com/support/patches.htm#filefix'.

    Once you stop Windows accessing the port, you should be able to get directly to the hardware ie: the 8255 pio chip, to understand how to do this you will need to identify the particular type of io chip being used and its base io address, with these you should be able to get something working in C++.

  3. #3
    Join Date
    Feb 2005
    Posts
    521
    Quote Originally Posted by Zumba View Post
    I'm experimenting with some simple programs in C++ and am trying to figure out how to access the parallel port. Apparently Win XP doesn't allow direct access to the port. Anyone have any pointers on which drivers to use? Thanks.
    Try inpout32.dll
    http://www.logix4u.net/inpout32.htm
    I've also attached a c# project I wrote that uses it for reading and flipping pport bits from a form (the port address is hard coded in Form.cs).

    My front doorbell uses this library to poll the pport and play a wav file when the button is pressed.

    But yes, you won't want to rely on it for driving machinery at any speed.

    Good luck, have fun!
    Attached Files Attached Files

  4. #4
    Join Date
    May 2005
    Posts
    674
    Thanks for the help guys. My programming skills are rusty but hopefully I'll be able to do it.

    BTW, does anyone know what Mach uses?

  5. #5

    Source Code Hunt

    I am looking for the source code for inpout32.dll if anyone can help me.

    Cheers DeWayne
    DeWayne

  6. #6
    Join Date
    May 2008
    Posts
    1

    Parallel Port Access

    Hi there, have done extensive work with the parallel port in both WinXP and Vista, a kernel mode driver is required, the one that I have found the best is TvicPort http://www.entechtaiwan.com/dev/port/index.shtm free for non commercial use works perfectly and easy to use under any programming langauge, I'm using .net and are able to trigger events from any of the port pins, the only bad thing I have found is that as Windows is not a real time operating system, high speed events sometimes fail, as at the end of the day if the Windows kernel decides to do something else (like defrag the hard drive) your event can be delayed or missed. On the bright side I have bit bashed many 8 bit controllers like the SJA1000 CAN controller directly from the parallel port so at slower speeds talking to an 82C55 wouldn't be a problem. The TvicPort comes with kernel mode driver (no point in recreating the wheel) and an extensive help file for all programming langauge, wish you all the best!

    Best regard Dave

  7. #7
    Join Date
    Feb 2010
    Posts
    371
    Quote Originally Posted by dewayne View Post
    I am looking for the source code for inpout32.dll if anyone can help me.

    Cheers DeWayne
    http://logix4u.net/inpout32_source_and_bins.zip

  8. #8
    Join Date
    Mar 2012
    Posts
    0
    FYI. We were also looking an Parallel control of stepper motors, and learned that if you're using a USB->Parallel port, most of the existing solutions for Bit level control will not work without finding a way to writhe your own drivers.

Similar Threads

  1. Where's the parallel port?
    By cdlenterprises in forum Mastercam
    Replies: 23
    Last Post: 01-21-2007, 12:23 AM
  2. 2nd PCI Parallel Port
    By sunmix in forum Mach Software (ArtSoft software)
    Replies: 8
    Last Post: 11-22-2006, 09:17 PM
  3. Second parallel port?
    By essa in forum LinuxCNC (formerly EMC2)
    Replies: 11
    Last Post: 04-12-2006, 08:18 AM
  4. Parallel port
    By Aldoseri in forum BobCad-Cam
    Replies: 11
    Last Post: 03-13-2006, 05:10 PM
  5. Parallel Port
    By Shanghyd in forum Computers / Desktops / Networking
    Replies: 1
    Last Post: 11-22-2004, 06:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •