LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I count the number of times a timed loop finished late?

I am getting occasional timing errors in a timed loop under windows XP and would like to count the number of errors, but I can't find a simple software counter vi
0 Kudos
Message 1 of 6
(2,683 Views)

You can count by adding a shift register to the loop (right click the loop wall), and incrementing the count only when there is an error.
You can use the example finder to find out more about shift registers.
You can also do this in a VI. Search this site for LV2 globals to see how.

To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(2,677 Views)
The timed loop has a terminal (boolean) to indicate if the previous iteration finished late. Just increment an integer shift register if this happens.
 
The attached shows a very simple demo (LabVIEW 7.1).
Message 3 of 6
(2,671 Views)
Thanks for the feedback guys. Altenbach - your solution is elegant - thanks!
 
Any ideas on how I can get better control of the windows environment and eliminate the timeout errors altogether? My guess is that the system is doing some housekeeping, resulting in the occasional timing errors I'm seeing.
 
Thanks again
 
John
0 Kudos
Message 4 of 6
(2,659 Views)
There are ways to cut down some of those, but to really get deterministic (especially at those levels), you need to use a real-time OS and do real-time programming. There are desktop systems which can run RTOSs. Check out the LV RT module.

___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(2,648 Views)
yes, I was afraid of that, thanks tst
0 Kudos
Message 6 of 6
(2,638 Views)