Timeout exception when reading from serial port
-
Dear all, I got Timeout exception when reading from serial port. how to overcome? code: // ports boudRate =115200, readtimeout=300 and writetimeout=300 private void btnRead_Click(object sender, EventArgs e) { OpenPort(); string str; try { Thread.Sleep(1000); str = _serialPort.ReadLine(); // exception occurs here } catch (Exception ex) { str = ex.Message; } txtReadText.Text += string.Format("{0}{1}", "", str); ClosePort(); }
-
Dear all, I got Timeout exception when reading from serial port. how to overcome? code: // ports boudRate =115200, readtimeout=300 and writetimeout=300 private void btnRead_Click(object sender, EventArgs e) { OpenPort(); string str; try { Thread.Sleep(1000); str = _serialPort.ReadLine(); // exception occurs here } catch (Exception ex) { str = ex.Message; } txtReadText.Text += string.Format("{0}{1}", "", str); ClosePort(); }
Oh how lovely; we're so proud.
-
Oh how lovely; we're so proud.
-
Dear all, I got Timeout exception when reading from serial port. how to overcome? code: // ports boudRate =115200, readtimeout=300 and writetimeout=300 private void btnRead_Click(object sender, EventArgs e) { OpenPort(); string str; try { Thread.Sleep(1000); str = _serialPort.ReadLine(); // exception occurs here } catch (Exception ex) { str = ex.Message; } txtReadText.Text += string.Format("{0}{1}", "", str); ClosePort(); }