Delphi + Reading Hexadecimal from Serial Port

mbeylis

Senior Member
Joined
Jun 8, 2006
Messages
564
Reaction score
2
Location
Benoni
Hi,

I am trying to write a program that reads Hexadecimal values from a Serial Port. I have tried multiple Third Party Com Port components but to date still can't get what I want

I can read the data from the Serial Port no problem but the data I am receiving seems to be "garbage". I think it has something to do with the Com Port components trying to convert the Hex to ASCII, I am not sure

For example the data I am currently getting from the Serial Port looks like this

Uª'#$14#0'*'#0'%'#$11#6#$13'"7'#$16#$B'¸'#3#6#0#3'='

When what I am expecting is a Buffer of 20 slots with each slot holding some sort of Hex Value

Has anyone worked with reading HEX from a Serial Port who can offer some assistance

Thanks
Mark
 
The first most common reason for receiving garbage is an incorrect baud rate, so make sure it is correct. Second download some sort of terminal emulation software (eg. RealTerm), with RealTerm you can change how the data received is displayed, set it to HEX and have a look if what you received is what you expected to receive.
 
Top
Sign up to the MyBroadband newsletter
X