polling scale device

G

Guest

I am writing a C# UI that must poll a scale device and update the some
controls with the current scale weight. I am now using the
System.Threading.Timer class. This seems to work OK except for shutting down
the timer thread. I want to be able to shutdown the polling thread and start
a new polling thread at will, but I do not think that when I call the timer's
Dispose method it is being shutdown.
My first questions are:
1) How to shutdown the System.Threading.Timer thread ?
2) Are there other bettier ways of doing the polling?

Thanks.
 
D

Dick Grier

Hi,

Daniel is right... However, a polling application with a serial device,
where the goal is to update UI elements is MUCH easier if you simply use the
forms Timer, not a system or threading timer. Then there are no threading
issue and performance actually improves!

Dick

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 4th
Edition ISBN 1-890422-28-2 (391 pages) published July 2004. See
www.mabry.com/vbpgser4 to order.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top