Sleppatloh Miw
Member
- Joined
- Jan 31, 2021
- Messages
- 10
- Programming Experience
- Beginner
Hi there,
For my project, I'm looking for a resolution for my problem. Every second I got a new data from my serial port. When I want to write this to a file, I only get one time the data that has been written.
What Do I have to to to fix this, a program code would be helpfull.
Kind regards and many Thx!
There are about 20 lines of data in my program, so every time the data changes (every second) it has to put this data in a new line in my csv file.
Many thx!
For my project, I'm looking for a resolution for my problem. Every second I got a new data from my serial port. When I want to write this to a file, I only get one time the data that has been written.
What Do I have to to to fix this, a program code would be helpfull.
Kind regards and many Thx!
StartWriteData:
private void BttnStartDataWriting_Click(object sender, RoutedEventArgs e)
{
string folderPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
TxtBlck_DataWritingStart.Text = "Writing to: " + folderPath;
string filePath = System.IO.Path.Combine(folderPath, "SavedDataDigitaleTeller.csv");
StreamWriter writer = File.CreateText(filePath);
string DataLoggerText = String.Format("{0} A", seriëleTelegram.StroomFaseR / 100); // is just one of my received data from my serial
writer.WriteLine(DataLoggerText);
writer.Close();
}
There are about 20 lines of data in my program, so every time the data changes (every second) it has to put this data in a new line in my csv file.
Many thx!
Last edited by a moderator: