Dim size As Integer = SerialPort1.BytesToRead If size < 2 Then Return End If Dim data(size - 1) As Byte SerialPort1.Read(data, 0, size)
Dim size As Integer = SerialPort1.BytesToRead If size < 2 Then Return End If Dim data(1) As Byte SerialPort1.Read(data, 0, 2)