Solved

c# timing

Posted on 2011-02-17
5
290 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Accepted Solution

by:
Praveen Kumar 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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

737 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