Controlling RS232 and LPT Port using VB .NET

  • Thread starter Wouter van Teijlingen
  • Start date
W

Wouter van Teijlingen

Dear Readers,

I was reading about how to control the COM and LPT port using VB .NET.
I've found a lot of information, and it was very useful to me. I found
an example program on the site of Microsoft. You can find it overhere:
http://www.microsoft.com/downloads/...ca-e4f1-4846-912c-b4ed37a1578b&DisplayLang=en

I did found a lot about the RS232 port on the Internet, but i haven't
found the same amount of information about controlling the LPT Port
using VB .NET.

I have two questions:

1. How can i change the power voltage on a pin in the COM Port? I wan't
to change it to 5Volt using VB .NET, but i haven't found anything about
this on the Internet.

2. How can i ''read'' a PIN from the LPT port. So if i set its value to
8Volt, is it possible to make a program that gives the value of the
power voltage on the pin?

It are my two main questions. I've found programs to control your
printer and modem in VB .NET, but i just can't find anything about this
subject on the internet. So you guys are my last hope:)

Thanks in advance,

Wouter van Teijlingen
The Netherlands
 
D

Dick Grier

Hi,

You might be interested in my book (see below). It covers .NET. I also
have controls that can be downloaded from my homepage. You will find the
IONet control for Visual Studio .NET 2003 useful for parallel IO.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 
D

Dick Grier

Also, you asked:
1. How can i change the power voltage on a pin in the COM Port? I wan't
to change it to 5Volt using VB .NET, but i haven't found anything about
this on the Internet.
<<<<<

You cannot. The voltage is fixed by the supply voltage to the RS-232
driver. You can limit the excursion to 5V using some add-on hardware, but
you cannot control this directly using software.
2. How can i ''read'' a PIN from the LPT port. So if i set its value to
8Volt, is it possible to make a program that gives the value of the
power voltage on the pin?
<<

The input voltage to the parallel port SHOULD NOT exceed 5V. If it does,
you may damage the port. The IONet control that I mentioned in my other
message provides both Input and Output method. Individual pins are mapped
to bits in one of the I/O registers at the printer port address.

However... These are digital IO pins. You cannot measure voltage. They
either are on (+5v) or off (0v). If you want to measure voltage, you need
an analog to digital converter. I suggest that you look at the PC Data
Acquisition link on my homepage. I show devices that do this -- some
connect to the serial port, others to the parallel port -- none are supplied
with a conventional computer. You have to add them.

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top