Q: Vb.net serial port help



I have some questions about serial port in vb.net.... I try only to
recieve data, and I'm using this to open port

With sPort
.PortName = "COM1"
.BaudRate = 9600
.Parity = IO.Ports.Parity.None
.DataBits = 8
.StopBits = IO.Ports.StopBits.One
.RtsEnable = True
.DtrEnable = True
.ReadTimeout = 1500

End With
and I have this event handler
txtBox.Invoke(New myDelegate(AddressOf updateTextBox), New Object() {})
and this sub and delegate
Public Sub updateTextBox()
With txtBox
End With
End Sub
This code is from vb.net 2005 example
When I recive some data from hyper terminal, this works fine..... But
when i try to recive data from eg. t central i have bunch of ??????. I
try to use in With
..Encoding = System.Text.Encoding.GetEncoding(28591)
..Encoding = System.Text.Encoding.GetEncoding(1252)
..Encoding = System.Text.Encoding.ASCII
but not work for me, HT recive this data OK.....
Can anybody help me with this problem.


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

Similar Threads