Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading Com Port at 4800 baud??

Status
Not open for further replies.

dabineri

Programmer
Jun 20, 2001
265
US
I am using VB6 and MSCOMM to read my com port but I need to read from a device that is sending at 4800,9,N,1. Niether the baud rate nor the number of data bits is supported by MSCOMM and yet the com port reads the data just fine so it must be capable of acheiving those parameters.

How, using VB6, am I able to capture this data? Is there a way?

Thanks for any help on this.

David Abineri

 
SORRY! It is an 8 bit word length, NOT 9. So it is just the baud rate that is of concern.

David Abineri

 
MSCOMM supports 4800 baud, no parity, 8 data bits, and 1 stop bit.

You shouldn't have any concerns.

When working with the serial port, I highly recommend you set up your computer for testing directly (without the hardware). It will speed up development time.

You will need....

2 com ports in your computer. If you don't have 2 com ports, you can purchase an I/O card that will provide extra com ports. These cards are cheap, really cheap. Just make sure, before you buy one, that you will be able to put it in your computer. They come in several varieties, most notable PCI, ISA, etc.

A null modem cable. You should be able to buy this at any Radio Shack, or you could make your own. A quick google search will show you how.

After you have all the hardware you need, you can use HyperTerminal for one 'end' of the connection, and your VB app as the other end.

I wrote a serial port writer application that allows you to type in to a text box and then click a send button. I set this to 4800,n,8,1 and didn't have any problems.

I shoudl also point out that your only problem may be the way you are setting your settings. In your original post you had 4800,9,N,1. You then corrected yourself with 8 data bits. If you specify the settings as 4800,8,N,1, you will have a problem. The correct order is baud,Parity,Data bits,Stop Bits. Try 4800,n,8,1 instead of 4800,8,N,1

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Thanks, George. The documentation I have does not show 4800 baud as a valid setting but it does appear to work fine.

Thanks again, David Abineri

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top