Need help with Parallel Port control using Vbasic in WINXP environment

S

Thread Starter

Student

Anyone know how to control a Parallel Port using Vbasic in a windowsXP env?

i am doing this school project..and i got NO idea about vbasic at all....not much of a programmer...

my first problem is that i cannot use the drivers the .dll files coz they are used for win98 and not winxp.

anyone know what i can do to solve this?

i need to create a program that will talk to devices on the other side of the parallel port, for now i have to just do simple stuff like an LED series of 8, then followed by harder stuff like a multiplexer etc.

anyone can help me please?

it would be greatly appreciated!
 
T

Tony H. - Machine Developement

Back in 1997 I worked with two Microsoft guys who helped me develop some software and hardware for controlling stepper motors out the parallel port using Visual Basic. I was using Visual Basic as the user friendly end for extracting CAD data from existing files via a "C" subroutine, then executing another subroutine with a shareware program called VBASSEM (or something like that).

This Visual Basic/Assembly language program allowed me to take control of the machine's parallel port in real time to push data pulses in and out of the parallel port. It worked great until Win 98 came out and Microsoft had disabled the ability to totally take over machine control using Assembly language. I needed the real time operation and abandoned further development of that method.

VBAssem might be a good place to start. I imagine it is still available and probably upgraded to the current versions of Windows.

Happy hunting, and come on Linux!!

Tony H., Tacoma, WA
 
R

Richard Fletcher

Up until about two weeks ago I was in the same state as you, Totally at a loss as to how to go about controlling the parellel port with visual basic.
GO HERE MATEY AND ALL WILL BE REVEALED!!

http://www.southwest.com.au/~jfuller/vb/vbout.htm

and here to get the io.DLL and parallel port monitor to use as component free test bed.

http://www.geekhideout.com/iodll.shtml
io.DLL (FREE FOR PERSONAL USE) ROCKS and controlls its way through 95-98-ME-2000 and XP! It is THE thing to get if you want to do this sort of thing. The guy who wrote it needs a medal for helping newbees! It saved my life and all you have to do is download it and copy it into C:/Windows/system.

All this is great stuff and got me well on my way into controlling the outside world with Visual Basic 6.
Things that might be of use for you to know:

Data lines (outputs) are decimal 888, control lines (outputs) are decimal 890 and the status lines (inputs) are decimal 889.

The first site I sugested tells you to start a new project and add a module......Me being new to all this couldnt get it to work like that so I just copied the list of declarations (found at the geekhideout) into the "GENERAL" area at the top of the form's code view.

Email me if you want to see my code for this and some ideas for form design and the like. As i speak the project has moved on in leaps and bounds towards demultiplexing the 8 data lines into 32 outputs! and multiplexing 16 input switches into the 4 input lines.

Good luck in the class and please do email. The blind leading the blind is always a good thing!

My urge to take over the world with my parallel port grows with every successful PortOut!!
 
try inpout32.dll/hwinterface.ocx from http://www.logix4u.net . these components will enable you to communicate with parallel port in WIN NT/2000/XP. i don't know whether it can be used with matlab, but it works with visual basic/ vc++.

 
G

Gregorio Cavazos

<p>Hi,

<p>The easiest way for me to interfase with parallel port in Vb is:

<p>First open port as a file:
Open "LPT1" For Binary Shared As #1

<p>Now if you want to send data to port just, write to file 1.

<p>Put #1, , outdata

<p>Where Put is the command to write to a file, #1 is the file, and outdata is the variable containing data being send to port. Outdata as to be declared as byte.

<p>Full Example:
<pre>
Private Sub SendData(data as byte)
Dim FrFile as integer
FrFile=FreeFile
Open "LPT1" For Binary Shared As #FrFile
Put # FrFile, ,data
Close #FrFile
End Sub
</pre>
<p>That's it, the data will remain at port until you send another data, Or you give a pulse at the pin (don’t remember the number) to ack, this pin is used by printers to say to PC that the byte has been read, so PC sends the next byte.

<p>There's another way using DriverLinx Port I/O, if you want to know I can tell you how to use it.

<p>If you need help, email me.

<p>Ing. José Gregorio Cavazos C.<br>
[email protected]
 
G

Gregorio Cavazos

Hi,

The easyest way for me to interfase with parallel port in Vb is:

First open port as a file: Open "LPT1" For Binary Shared As #1

Now if you want to send data to port just, write to file 1.

Put #1, , outdata

Where Put is the command to write to a file, #1 is the file, and outdata is the variable containing data being send to port. Outdata as to be declared as byte.

Full Example:

Private Sub SendData(data as byte) Dim FrFile as integer FrFile=FreeFile Open "LPT1" For Binary Shared As #FrFile Put # FrFile, ,data Close #FrFile End Sub

That's it, the data will remain at port until you send another data, Or you give a pulse at the pin (don’t remember the number) to ack, this pin is used by printers to say to PC that the byte has been read, so PC sends the next byte.

There's another way using DriverLinx Port I/O, if you want to know I

can tell you how to use it.

If you need help, email me.

Ing. José Gregorio Cavazos C. [email protected]
 
Hi,
I want to use the serial port (com1) instead of the parallel port. What is the com1 number?

lpt1 : portout(888,x)
com1 : portout(???,x)

 
Hi

please can anybody help me? i'm having the same problem with controlling the parallel port with visual basic and im finding it hard to download the dll file onto the university system. it's my final year project. i will appreciate anybody who can send the codes to my email address with a little note.

cheers
[email protected]
 
G

george albert

<pre>
**************************
*Name * Address* IRQ *
* ************************
*COM1 * 3F8 * 4 *
* ************************
*COM2 * 2F8 * 3 *
**************************
*COM3 * 3E8 * 4 *
**************************
*COM4 * 2E8 * 3 *
**************************
</pre>
<p>if you need more help go to http://www.senet.com.au/~cpeacock
to find a long pdf go to page 12 to read more

<p>If it works send me email at [email protected]
 
Top