ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop Timer

Hello,

I have a loop that executes some functions to run a camera frame by frame. I have successfully used shift registers and a millisecond timer to create a feedback loop that displays the time required to iterate one individual loop run. 

 

What I am really needing to do from here is to create a timer that will show me how long the loop runs for a total amount of time, given an arbitratry number of iterations. The loop executes when I hit a boolean button that creates a true condition for the case selectector that drives the camera and other code. The loop outside that simply checks the T/F boolean button for changes, and when I deselect the button the loop stops. I am trying to determine the time interval from when I first hit the button to start the loop, it iterates "i" times, and then when I hit the start button again to stop the loop.

 

Thanks

0 Kudos
Message 1 of 3
(3,661 Views)

There are many ways to time your code, but first we'll need to see your code 🙂 I'll take a look if you upload for LV 2012. If you are using a more recent version just go to File >> Save for previous version...

0 Kudos
Message 2 of 3
(3,645 Views)

I'm not sure whether I understood the problem clearly.
- you have a loop,inside that there is case structure. You want to get the total time true case executed.
- you can use elapsed time inside true case https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/vi-lib/express/express-execution-control/e...
- use shift register and add this time in true case and false case simply pass it to next iteration.
-you can also use tick counts to get the time true case executed and add that timings.
-hope you are familiar with case structure,shift register and Loop. If not : https://learn.ni.com/learn/article/labview-tutorial

Thanks
uday
0 Kudos
Message 3 of 3
(3,607 Views)