Hi All,
I am at a beginner level. I want to read all byte from serial until &H29. I have simple code below but it take over 6 seconds.
Could you help to make it faster? or share better method. ( I try same data with commercial software it less than 1 sec )
Code:
Function GetBytes() As String
Dim serialbyte(350000) As Byte 'For example set maximum byte is 350000
Dim count As Integer = 0
Dim i As Integer = 0
Dim rcb As Byte
While rcb <> &H29
rcb = SerialPort2.ReadByte
serialbyte(i) = rcb
i += 1
End While
Dim str = "Nothing"
Return str
End Function