Solved

c# timing

Posted on 2011-02-17
5
289 Views
Last Modified: 2013-12-17
Hi,

I am waiting for data from serial port, how can I set the timer for 5 minutes and quit if I
don't receive any data?

Thanks,
JT
0
Comment
Question by:jtran007
5 Comments
 
LVL 12

Accepted Solution

by:
Mamtha1982 earned 250 total points
ID: 34914573
Set your timer Interval property to 300000 (milliseconds i.e. 5 mins)


If the timer event,

1. Stop the timer
2. try to read the data from serialport
3. if found process it and start the timer
4. if not found, start the timer
0
 
LVL 8

Expert Comment

by:jimsweb
ID: 34914576
The Timer control allows you to set a time interval to execute an event after that interval continuously. It is useful when you want to execute certain applications after a certain interval.

http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingwithTimerControlinCSharp11302005054911AM/WorkingwithTimerControlinCSharp.aspx

http://www.csharphelp.com/2006/02/c-timer-demo/
0
 

Author Comment

by:jtran007
ID: 34932924
Hi,

Thanks. After timer expires, I'd like to grap a datafile located in the resources folder. How can I do it?

Thanks,
JT
0
 
LVL 7

Expert Comment

by:dimaj
ID: 34948201
What do you mean by "grap a datafile"?
0
 

Author Closing Comment

by:jtran007
ID: 34966575
Thanks,
JT
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Change to file doesn't show up 16 73
WPF Select Items 3 24
locate sql commands in C# visual studio Project 6 35
VB.net Filesystem watcher not working 5 31
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question