Sub outputToCons
Dim buf(consOut.BytesAvailable) As Byte
If consOut.BytesAvailable > 0 Then
consOut.ReadBytes(buf,0,consOut.BytesAvailable)
Dim st As String = BytesToString(buf,0,buf.Length,"utf8")
TextArea1.text = TextArea1.text & st
TextArea1.SelectAll
TextArea1.SetSelection(TextArea1.SelectionEnd,TextArea1.SelectionEnd)
End If
Sleep(20)
If consOut.BytesAvailable>0 Then outputToCons
End Sub