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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

odd return from com ports

Status
Not open for further replies.

Malcav

Programmer
Oct 7, 2005
43
GB
Ok Have a program that reads from a com port. Not done this before so have read up on it. The code I have seems to be programmed fine. It connects and retreives data. However it is not the right data. Values should range from 0-F this is what is returned

ü<þ8|üü<þ|þpŽ<þþ|ü€Ž<<ü8~þýŸÿ‚,|‚ýhLäXHýý(Ÿ(ùŠþ*><=úüO<Ž"
…Æ>IýþûºÿýüŽ…,ÿü¾š|þüȾþüü%Œ<ÿ<þüžüþýüþŽ<üü‹þ <ö

Also there should be rought 2-3Kb of it not a few lines.
Could it be an ascii - unicode problem?
 
My guess is there is something wrong with the port settings like baudrate, databits, parity, stopbits. Look in MSDN Library for SetCommState, GetCommState and DCB.

Marcel
 
Os : windows xp
comp : ? normal desk top pc
 
Ok. Know nothing about programming com ports under Windoze, but as mentioned about, it looks like a wrong baud rate to me... what baudrate were you expecting?

And what is the pc connected to?
 
Hi
Thanks for the help but I have reprogrammed the entire program to use sql rather than 'faircom' (whatever that is) and we already have an service the gets the data.
 
Use hyperterminal and play with the connection settings (baud rate etc) until you find out what is actually being used.

It will be quicker than edit / compile / test for your code.


--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top