title: USB COM port data reading error
body: <p>I am using people count device to read the InCount, Out Count record and it is connected with my PC COM3 USB port.. I have written the code to fetch the data, I am continuously receiving the below message while reading the data..... can I have some code or idea to fetch the record?</p>
  
  <p>message is.... The operation has timed out.</p>
  
  <p><strong>mycode is below:</strong></p>
  
  <pre><code>Function ReceiveSerialData() As String
      ' Receive strings from a serial port. 
      Dim returnStr As String = ""
  
      Dim com1 As IO.Ports.SerialPort
      'SerialPort sp = new SerialPort("COM3", 115200, Parity.None, 8, StopBits.One);     
  
      Try
          com1 = My.Computer.Ports.OpenSerialPort("COM3")
          com1.BaudRate = 115200
          com1.ReadTimeout = 10000
  
          Do
              Dim Incoming As String = com1.ReadLine()
              If Incoming Is Nothing Then
                  Exit Do
              Else
                  returnStr &amp;= Incoming &amp; vbCrLf
              End If
          Loop
      Catch ex As TimeoutException
          returnStr = "Error: Serial Port read timed out."
      Finally
          If com1 IsNot Nothing Then com1.Close()
      End Try
  
      Return returnStr
  End Function
  </code></pre>