sumit Kale

sumit Kale

  • NA
  • 65
  • 2.6k

How to imptove performance of serialport data reading

Jun 14 2017 9:56 AM
Hello,
 
I am developing app to monitor the serialport data. Right now i am able to get serialport data & display over datagridview.
 
However i am missing 20-30% of incoming datastream to reflect over datagridview. My data is coming with 5.25Mbps speed.
 
Poosible error :
1. Use of strings & conversion to Hex data which consumes more time & overwrites data
2. Interlinking of different threads & functions in program.
 
Possible Solution:
1. use of Queue & indexes which can act as ring buffer
2. Data logging (Raw binary stream) in different thread & save to file over PC & later use this file to display data over datagridview using Streamreader.
 
So can anybody tell me whats wrong in my current version. How i can improve performace so that i can display what i got from serialport without any data leakage.
 
Also how i can automatically save data using streamwriter when i click the start button. It can be a backgroundworker or parallel activity along with reading & displaying data over datagridview.
  

Attachment: Form1.zip

Answers (2)