LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create timer for my vi

The portion of my project I'm currently working on requires to keep the time in between iteration of a for loop.

I want to be able to have a "time keeper" when I start the loop (in an event structure) to be shown in the front panel.

And also how do I get the "start time" of each iteration as there will be time delay ie wait time which is controlled by user assuming that there is no/negligible time in the processing?

And finally how do I make the event structure stop automatically after all the iterations are completed (for loop)?

Thank you.

Attached is the simplified vi.
0 Kudos
Message 1 of 2
(2,445 Views)
Hi,

First of all, replace the Wait function with a Wait until ms multiple function. This will give a more reproducible timing.

As to the event case ending after the iterations are done, I think this is automatically implied by your code. As soon as the code within the event case has executed, the event case is finished (unless it's in a loop, when it might be called again depending on user actions....).

You can also read out the current ms counter at the start of each loop to get the real loop start time if you want. Additionally, getting one at the end of the loop will enable you to find out approximately how long each loop takes. If this is close to, or more than your wait interval, you'll certainly have problems with your timing.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 2
(2,439 Views)