R
Richard
I'm new to this type of programming, so please bear with me. I just came
over from Top Down style Pascal. (Yes lots of books, evidently the wrong
books).
My program will read data from an ADC card, and then grabs some readings
from the serial port (PLC) each time the timer fires its event set at
whatever interval I desire. (100ms)
Is there a way to keep the new timer event from firing if the previous timer
event hasn't completed yet?
For simplicity, I would rather recieve the data from the comport and manage
that data before ending my timer event. My idea was simply set a timeout
for the serial port routines at 1 second, so if for some reason I don't get
a response, I flag an error, however if I do that, then won't I get ten more
instances of the timer event being fired which could lead to a big mess?
So Basically, when the code in the timer event might take longer than the
timer interval on occasion, how is the best way to handle it?
Thanks
over from Top Down style Pascal. (Yes lots of books, evidently the wrong
books).
My program will read data from an ADC card, and then grabs some readings
from the serial port (PLC) each time the timer fires its event set at
whatever interval I desire. (100ms)
Is there a way to keep the new timer event from firing if the previous timer
event hasn't completed yet?
For simplicity, I would rather recieve the data from the comport and manage
that data before ending my timer event. My idea was simply set a timeout
for the serial port routines at 1 second, so if for some reason I don't get
a response, I flag an error, however if I do that, then won't I get ten more
instances of the timer event being fired which could lead to a big mess?
So Basically, when the code in the timer event might take longer than the
timer interval on occasion, how is the best way to handle it?
Thanks