PORTS Forum

Ports and Interfaces => Serial Ports => Topic started by: ashsrisam on October 28, 2011, 04:46:17 pm

Title: Saving serial data to a .dat/.txt file
Post by: ashsrisam 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
Title: Re: Saving serial data to a .dat/.txt file
Post by: Jan Axelson 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
Title: Re: Saving serial data to a .dat/.txt file
Post by: ashsrisam on October 31, 2011, 11:22:57 am
Thank you Ms. Axelson!  :)