Author Topic: Saving serial data to a .dat/.txt file  (Read 3999 times)

ashsrisam

  • Member
  • ***
  • Posts: 2
Saving serial data to a .dat/.txt file
« on: October 28, 2011, 04:46:17 pm »
Hello,

I'm trying to understand and then modify Ms. Axelson's 'com_port_terminal_vb' program so that I can save the data I receive from a serial COM port onto a different file. I'm finding it very difficult as i have next to no experience with VB.Net. I'd really appreciate any help you guys can give me.

Thank you,

-Ashwin

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2848
    • Lakeview Research
Re: Saving serial data to a .dat/.txt file
« Reply #1 on: October 28, 2011, 06:24:42 pm »
The data received is stored in the DataReceived routine in the newReceivedData variable. From there you can do whatever you want with the data.

To store the data in a file, see the File and StreamWriter classes. For VB, another option is Microsoft.VisualBasic.FileIO.FileSystem class. A web search on these should bring up examples.

Jan

ashsrisam

  • Member
  • ***
  • Posts: 2
Re: Saving serial data to a .dat/.txt file
« Reply #2 on: October 31, 2011, 11:22:57 am »
Thank you Ms. Axelson!  :)