Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help to catch & record a fast-changing variable 1

Status
Not open for further replies.

ColdPhreze

Programmer
Apr 15, 2002
93
Ok, here it goes

I am writing an application that needs to use minimal system resources AND needs to be able to catch and record a fast-changing variable. It's fast enough that a timer interval of 1 is too slow.

FYI: the variable is one in a serial port class - not one I created, and is changing based on conditions external to the PC.

In a console app, I know I could poll in a loop, but that is cpu intensive, and I need forms in this app.

Is there any way I could set an event to occur when a variable changes value? Or can I somehow poll at 0.1 millisecond intervals?

Thank you very much,
KyferEz

Check out my DeVry Senior Project: and my CarPC Hardware:
 
Poll in a loop in a different thread.
Do some research on threading.

But there is a serialport component that has events? One of them ebing DataReceived. At least in the 2.0 framework.

Christiaan Baes
Belgium

"My new site" - Me
 
Thanks again Christiaan. You are very helpful.

I think threads could work, but what you mentioned about the component having events got me checking into it more, and man I feel like an idiot now. You are right, the class does have the ability to throw an event any time a it recieves data or a status line changes state.

FYI: The free serial port class I'm using is available here:

Thanks
KyferEz

Check out my DeVry Senior Project: and my CarPC Hardware: and my Spam-Fighter forums:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top