RS232 encoding

Densa

New member
Joined
Jun 12, 2007
Messages
2
Programming Experience
Beginner
I am trying to send hex over rs232. When I physically connect Rx to Tx on the port all is fine untill I reach value &h80. I have tried changing the encoding to sport.Encoding = System.Text.Encoding. (then various types) But I am unable to get what should be a simple echo back of the hex value sent. Is there a way of setting up the port to be able to do this?
 
Use one of the Encoding.UTF8/Unicode/UTF32 or other that support extended character set beyond the ASCII 127, using ASCII will send chr(63) (question mark) if above.

After having sent chr(128) to the loopback I get some strange result when using the ReadChar method (8364), but for example MsgBox(Asc(sport.ReadLine()(0))) will output correct 128, so will also the encoding GetChars method.
 
RS232 Encoding

Thats cracked it! Used UTF8 encoding, write(chr()) and readchar(). Now getting echo of hex sent. Many thanks for your help.

Densa
 
Back
Top