Talking to a Parallel port

Is there a way to programmatically talk to a parallel port? I know how to talk to a serial port using the mscomm control, but I'd like to send a constant stream of bits (hopefully to a particular pin) and I think using the serial port would eat up all the memory.

The mscomm control is also geared towards modem communications, which I don't really want - I'd probably like a lower level function to say "start sending bits to pin 5 now" and "stop sending bits now".
ismhomeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

adityauCommented:
Download the driver from the following site for PCL-720 and it gives you some API's to program Parallel port.

http://www.advantech.com/products/automation_software/dll-driver.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
amartiCommented:
You can use VB with Printer comands, but only to write, with limitations, to pin's 1-9 of conector DB-25 of parallel port.   But to talk with parallel port you can use DLL you can find in
http://www.zdnet.com/swlib/  searching 'parallel port', like IOPort.VBX (VB3) or LPT.OCX (VB5,6)

This DLL has capability to do input (INP or PEEK function) or output (OUT or POKE function) from Parallel Port, no permited in Visual Basic alone.   The best explanation I found in:
Peter Anderson Home Page (http://www.access.digex.net/~pha/)
Jane Axelson Page, or http://www.lvr.com/parport.htm

Then, your code can use DLL's funcion for input or output electronic signals in pin's of DB25 conector.  If your computer has bidirectional Parallel Port, you can use 1 to 9 pin's for both input and output; if not you can use 1-9 for output and others (13, 15, ..) for input.  In any case, you use a decimal value 0-255 for values of 8 bits (binary to decimal conversion), with this code:

Dir =888 'decimal address for Paralell Port
OUT Dir, 0 'for clearing port
'For write
  Valor= 'decimal value for 8 bits, corresponding to 8 signals in connector pi`'s
  OUT Dir, Valor


'For output
  Input = INP(Dir + 1) 'Register for output is following address




0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.