PDA

View Full Version : C++, Win XP, Parallel Port



Zumba
02-22-2007, 06:53 AM
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.

davidmb
02-22-2007, 08:00 AM
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++.

10bulls
02-22-2007, 05:56 PM
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!

Zumba
02-23-2007, 07:37 AM
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?

dewayne
07-06-2008, 09:03 AM
I am looking for the source code for inpout32.dll if anyone can help me.

Cheers DeWayne

Dave Ryder
04-27-2009, 06:55 AM
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

AiR_GuNNeR
03-17-2011, 03:28 PM
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

JRProbes
03-29-2012, 02:12 PM
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.