TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Loh Jy
NA
17
3.9k
Time delay or data delay
Jun 4 2015 10:23 PM
What should i do on the coding if i only want to capture 1 time stamp for the data I received?
As data being received bit by bit, the time is also ticking.. As a result, now a time stamp is shown after every bit of data received.
Interval between each full set of data is roughly 10s apart while interval between each bit of data is roughly... 20millisec..
Coding as follows:
private void serialPort1_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
string time = DateTime.Now.ToString("HH:mm:ss.ff"); //Display Real time per received data
RxString = serialPort1.ReadExisting();
this.Invoke(new EventHandler(DisplayText));
StreamWriter MyStreamWriter = new StreamWriter(@"c:\test1.txt",true); //True tell SW to append to file instead of overwriting
MyStreamWriter.Write(time + " " + RxString); //Write time + string
MyStreamWriter.Flush();
MyStreamWriter.Close();
}
Reply
Answers (
1
)
How to set a default value to a textbox
Login Exchange : The Autodiscover service couldn't be locate