doesn't show the non-printable characters.
If i send chr(248) I want to se"ø" in th etext box.
This works fine in VB6 using the MSComm control.
"Lou" <lou.garvin@comcast.net> wrote in message
news:OFIk8joCHHA.4404@TK2MSFTNGP06.phx.gbl...
> Dick, your the best!
>
> "Dick Grier" <dick_grierNOSPAM@.msn.com> wrote in message
> news:u0dq0pOCHHA.4024@TK2MSFTNGP04.phx.gbl...
>> Hi,
>>
>> Use the Read method and assign to an array of type Byte. Do not use a
>> String.
>>
>> ReadExisting is for strings. Binary data (values > &H7F) should not
>> attempt to use String, but rather arrays of bytes. I have more detailed
>> information and examples in my book (see below). But, to get you
>> started:
>>
>> Dim Count As Integer = SerialPort.BytesToRead
>>
>> Dim Buffer(0 To Count - 1) As Byte
>>
>> Text2Display = ""
>>
>> SerialPort.Read(Buffer, 0, Count)
>>
>> If MenuItem13.Checked = False Then 'text display
>>
>> Text2Display = System.Text.Encoding.ASCII.GetString(Buffer, 0,
>> Buffer.Length)
>>
>>
>>
>> Else
>>
>> 'binary display
>>
>> For I As Integer = 0 To Buffer.GetUpperBound(0)
>>
>> Text2Display += Buffer(I).ToString("X2") & " "
>>
>> Next
>>
>> End If
>>
>> You now can call Invoke or BeginInvoke to marshal data in the
>> Text2Display buffer to be shown.
>>
>> Dick
>> --
>> Richard Grier, MVP
>> Hard & Software
>> Author of Visual Basic Programmer's Guide to Serial Communications,
>> Fourth Edition,
>> ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March
>> 2006.
>> See
www.hardandsoftware.net for details and contact information.
>>
>
>