Thank you very much for any advice you can give me. I've been pulling my hair out all morning over this.
I am observing some very confusing behavior from my timer controls.
Let's say I have a timer with an interval of 20ms and it is always enabled. The code associated with the timer event takes 5ms to execute. Will that code be executed every 20ms or every 25ms? In other words, does the timer continute to run while it's event is being executed? [I would hope yes] (This is a type of data acq. application, so I need exact timing.) Can anything else pause or slow a timer?
A related question concerns re-trigger-ability. Let's say I have the same timer but that its event code takes 50ms to execute. Does the event get triggered again 20ms into execution, thus eventually overflowing the stack? Or, are subsequent events ignored until execution is complete? If they are ignored, then when event execution finishes, and a trigger has been missed, does it execute the event right away or does it wait until the timer triggers again?
If you read the help file, you get the idea that timer truly generates an event at an exact regular interval. However, in my program, I never get as many total events out of my timer as I expect, even if I lengthen the interval so that it is much longer than the time required to execute the event code.
I am observing some very confusing behavior from my timer controls.
Let's say I have a timer with an interval of 20ms and it is always enabled. The code associated with the timer event takes 5ms to execute. Will that code be executed every 20ms or every 25ms? In other words, does the timer continute to run while it's event is being executed? [I would hope yes] (This is a type of data acq. application, so I need exact timing.) Can anything else pause or slow a timer?
A related question concerns re-trigger-ability. Let's say I have the same timer but that its event code takes 50ms to execute. Does the event get triggered again 20ms into execution, thus eventually overflowing the stack? Or, are subsequent events ignored until execution is complete? If they are ignored, then when event execution finishes, and a trigger has been missed, does it execute the event right away or does it wait until the timer triggers again?
If you read the help file, you get the idea that timer truly generates an event at an exact regular interval. However, in my program, I never get as many total events out of my timer as I expect, even if I lengthen the interval so that it is much longer than the time required to execute the event code.