Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

c# timing

Posted on 2011-02-17
5
Medium Priority
?
295 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:
Praveen Kumar earned 1000 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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

877 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