Dim bin() As Byte = BitConverter.GetBytes(-1)
Dim length As Integer = SerialPort1.BytesToRead If length = 0 Then Return End If Dim data(length - 1) As Byte If SerialPort1.Read(data, 0, data.Length) > 0 Then Debug.WriteLine("{0:yyyy/MM/dd HH:mm:ss.fff} {1} len={2} : ", Now, e.EventType, length, BitConverter.ToString(data)) 'Invoke(New Delegate_RcvDataToTextBox(AddressOf Me.RcvDataToTextBox), data) End If