I have a problem that only happens sometimes. I send a string to the comport and then wait for a reply. I am tring to receive a 7 byte block form the comport and sometimes I lose the first byte. When this happen it will do it every time I try I can resend the request and will recive 6 bytes. Other times it will work fine when I run it and every time I try after that. Any Ideas?

This is what I should reciev in HEX if that matters
31 0D 0a 50 54 58 3E


Opening port

VB Code:
  1. With MSComm1
  2.       .CommPort = 5 'ComPort
  3.       .Handshaking = comNone '2 - comRTS
  4.       .RThreshold = 1
  5.       .RTSEnable = True
  6.       .DTREnable = True
  7.       .Settings = "9600,n,8,1"
  8.       .SThreshold = 1
  9.       .InputMode = comInputModeText
  10.       .InputLen = 1
  11.       .PortOpen = True
  12.       ' Leave all other settings as default values.
  13.     End With

Writing what read to text1.text

VB Code:
  1. Do While Timer < TimeOut + 1
  2.     If FrmHitScores.MSComm1.InBufferCount > 0 Then             'to be sure something in the buffer
  3.       sTEMP = MSComm1.Input                           'get a byte
  4.       strRX = strRX & sTEMP                           'assemble the input bytes into strRX
  5.     End If
  6.     If Len(strRX) = 7 Then      
  7.       for a = 1 to 7
  8.          text1.text = text1.text & Hex(Asc(Mid$(strRX, a, 1)))
  9.       next a
  10.       strRX = ""
  11.       Exit Do
  12.     End If
  13.   Loop