Author Topic: Collecting received data  (Read 9147 times)

ancolli

  • Member
  • ***
  • Posts: 1
Collecting received data
« on: February 06, 2015, 09:51:17 am »
I am working on a project that receive data from a pic (AD conversión of physical variables). In the past I have developed a code in VB6 to collect data, plot it and save as .txt file, the code was based on timer and the resolution was limited. But now I need more data per second and I have migrated to VB .net. I have doubts about the better form to do the task . Based in your experience, Would you recommend using the datareceived event or using the stringbuilder class?. Maybe you have some code that you can share with me.
Thank you very much for any help you can provide

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Collecting received data
« Reply #1 on: February 06, 2015, 12:50:29 pm »
The SerialPort class's DataReceived event eliminates the need to poll for new data and thus can give better performance. You can use StringBuilder to store the received data.