• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 399
  • Last Modified:

Visual Basic and Parallel Port (read/write)

I have visual Basic and i want to read /write to parallel port. TO Pscal was eisy using Port[] command but i don't know how i write byte or read byte to parallel. If you know haw i read/write to parallel ask me.
0
tzelve
Asked:
tzelve
  • 2
1 Solution
 
DalinCommented:
tzelve,
VB does not have a control that communicate to the parallel port directly similar to  MSComm to serial port. So it is not a easy task. There may be 3rd party control available, but I have not seen one yet.

               If you would like to exploring low level communication to parallel port,  you can find useful information in :
                   http://www.doc.ic.ac.uk/~ih/doc/par/
                   http://www.senet.com.au/~cpeacock/parallel.htm
                   http://et.nmsu.edu/~etti/fall96/computer/printer/printer.html
                 Regards
0
 
Joe_GriffithCommented:
You can communicate to a parallel port directly just like a file:

  Dim fn As Integer
  fn = FreeFile
  Open "lpt1:" For Output As fn
  Print #fn, "Hello"
  Print #fn, vbFormFeed
  Close #fn
0
 
DalinCommented:
In the above method, you are not communicate to the port itself. Rather, you are communicate with the printer driver set in the port.
You send the data to the driver and the driver translate into low lever command.  You  can not read or write bytes data to the port with that method.

VB does not support write to a memory address like the old GWBasic in which you can Poke a byte.
0
 
kfrickCommented:
I have used the following DirectIO .dll to communicate directly with the Parallel Port Chip. You must know the address of the chip, and how it operates, to have the chip control the Port as you require.

DirectIO dDriver DLL available at:
http://www.advantech.com/support/down_dir.htm

It is intended for use with their products, but it also works for the Parallel Port.....

Good Luck!

-kf
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now