LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

timed loop is not accurate

I have met a problem related with 1 MHZ timed loop. i am using a PXI 8186 as a controller, LabVIEW RT 7.1 as software platform. when I chose 1MHZ clock, i found that it is not accurate at all. i had hoped that the timed loop execute the diagram in every 500,000us. I use the function "tick count" to see the actual time interval, sometimes i got 900,000us, sometimes I got 100,00us. could someone tell where would the problem possibly be?
0 Kudos
Message 1 of 4
(3,345 Views)
I don't have LV Real Time so I can't choose the 1MHz clock.  However, the timing has always been accurate using the 1KHz clock.  I can't see why using a 1MHz clock would throw it off.  Perhaps it is something in your setup or in your code.  What is your period?  If you are looking at 900,000uS, which is almost one full second, why are you using the 1MHz clock instead of 1KHz.  I can't believe that timed loop can vary from 900,000uS to 100,000uS.  That is almost one second difference.  I don't think the timed loop itself is the problem.  It has to be in your setup of the loop or the way you measure time using tick count.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(3,317 Views)
Don't use tick count to measure loop rate. In a timed loop, you can access the the actual start time from a terminal on the inside of the loop.
 
What else is in your loop? Any code that has variable execution time? Do you enforce execution order between tick count and the rest of the loop content?
 
There are also indications that "tick count" can lead to performance problems on some platforms if the loop rate is very fast and you create an executable. See this thread:
 
0 Kudos
Message 3 of 4
(3,304 Views)
thank you for all the replies
 
there is one thing that i forgot to mention.i ran the same diagram on a PC with ETS OS and LabVIEW RT, this time i got the accurate timed
loop. The attached is the diagram i used to test the timed loop. it seems that the timed loop is not accurate only in PXI?  To make sure it is not caused by tick count subvi, i set the loop time to 1 second so that i could see with my eyes that the loop time is not accurate. for example one loop is 1.2 second another is 0.2 second. it only happens in 1MHZ and I also find that the time loop is accurate  in 1KHZ .
0 Kudos
Message 4 of 4
(3,283 Views)