Does this reply always have a fixed length? If yes, you can set ReceivedBytesThreshold-Property to that value, so that the Received event will only fire if all data has arrived.
Quote:
|
Which translates out to 96 01 50 51 74
|
We are still talking about Hex-Values and not Decimal-Values, do we?
Try This:
Code:
Private Sub DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles serialPort.DataReceived
Dim rcvBuf(Me.serialPort.ReadBufferSize) As Byte
Dim read As Integer = Int32.MinValue
read = Me.serialPort.Read(rcvBuf, 0, rcvBuf.Length)
Dim res As New StringBuilder()
For i As Integer = 0 To read Step 1
res.Append(rcvBuf(i).ToString("X2"))
Next
Debug.Print(res.ToString())
End Sub
This should print every received data to the Debug-Window.
Bobby