LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The Cycletime of a while loop?

Hi,
 
i want to know the cycletime of my while loop?
How can i write this in an array?
 
Thanks for your anwers
 
HRC
0 Kudos
Message 1 of 6
(3,335 Views)

Use a shift register to remember the value of the ms counter (Time & Dialog palette) and subtract the current value. Note the use of the sequence structure to make sure the time is taken only when the loop finished executing its code.


___________________
Try to take over the world!
0 Kudos
Message 2 of 6
(3,330 Views)

HI,

thanks for the answer, is that the only way to see the cycletime of a while loop?

I tried it but in the array are no data, also if had stopped the vi.

0 Kudos
Message 3 of 6
(3,327 Views)

Hi

ok now i see data in the array but the data don't stay and fill the array, how can i do this?

Than i have the wait until next ms multiple in my vi, tha time is 1 second. When execute the vi i thought that the time value should be stabil on 1000 ms but it jumps every iteration from 52 to 451 or to 987 and so on.

What is the problem?

 

0 Kudos
Message 4 of 6
(3,318 Views)
The only way the array can have no data is if you click the abort button. If you clicked the stop button the array should have a very (very) long list of 0s (with a rare 1), because the minimum is 1 ms and since this loop does nothing, it can run a great number of times in a single ms.
 
If your loop will take longer to execute, you will see the result.

___________________
Try to take over the world!
0 Kudos
Message 5 of 6
(3,315 Views)
You should read the help for it. Wait until next ms multiple does just that - it waits until reaching a multiple of the ms counter. That means that depending on how long your code actually takes to execute, you may get some variation. If you want a rigid wait, use the Wait function instead. You might get some jitter here as well, but it will be much smaller (on the order of a few ms). Have a look at this for a good explanation.

___________________
Try to take over the world!
0 Kudos
Message 6 of 6
(3,310 Views)