Quote:
Originally Posted by Mark McLeod
In your case the 5ms timed loop will repeat every 5 ms or as soon as the task scheduler allows after 5ms are up.
The timer vi counts down from the moment it is started, and usually that's co-incident with the loop starting.
|
Now things are not making sense again:
- At time t=0 the CPU encounters the 5ms timer vi so the CPU goes away and does something else.
-
When the CPU comes back to execute the code it is now t=5ms.
- the code takes 1ms to execute. It is now t=6ms.
- the task loops back to the beginning and encounters the 5ms timer vi again. The CPU goes away for 5ms, and when it comes back, it is now t=11ms.
-
the code now starts executing again at t=11ms.
Therefore, the period is 11-5 = 6ms, not 5ms.
What is wrong with the above argument?
~