Solved

c# timing

Posted on 2011-02-17
5
286 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now