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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continual monitoring

Status
Not open for further replies.

philrosenberg

Technical User
Dec 3, 2003
15
GB
Hi everyone.
This is more an programming for windows/algorithm question rather than a code question, if any of you can help I'd be really greatful.

I'm trying to use a pc to monitor input and set output to the parrallel port. (for those of you that are interested I'm using a PICO interface to moniter a thermometer and turn a heater on and off to regulate temperature).
I have a library (that was supplied with the PICO) that includes a function get_value() that gets the input and set_value() that turns the output on and off.
How can I write a program to continually moniter the input without the program hanging. Is there any code I can use to beak a while loop when a message is sent to my program.

Cheers
 
Well my guess would be that you set up a timer to trigger once a second. The associated callback calls get_value() and set_value() once (as appropriate).

So once a second, you sample (and perhaps respond) to the temperature reading.

The rest of your win32 application carries on as it would normally.

--
 
you may also creat a separated thread.

Ion Filipski
1c.bmp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top