I'm trying to read data from rs232 port
When I use the above code I'm able to put received character in a text box, but if I use:
only first 2 or 3 characters are putted in text box.
Every help will be greatly appreciated.
Thank you.
VB.NET:
Private Sub InPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles InPort1.DataReceived
Dim StIn, StOut As String
StIn = InPort1.ReadExisting
StOut = StIn
OutPort.Write(StOut)
For i = 1 To StIn.Length
Sys = Mid(StIn, i, 1)
SetText(Sys)
Next
End Sub
VB.NET:
Private Sub InPort1_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles InPort1.DataReceived
Dim StIn, StOut As String
StIn = InPort1.ReadExisting
StOut = StIn
OutPort.Write(StOut)
SetText(StIn)
End Sub
only first 2 or 3 characters are putted in text box.
Every help will be greatly appreciated.
Thank you.