Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

sub VI, time measurement

Hi,
 
I have 2 basic, begineer questions:
 
1- Is there a special timer for measuring the time of my application / a loop execution? Or i need to program it?
 
2- How can I create a second of indicators or controls in a VI to avoid extra wiring? I want its value to follow the value of the first control.
 
 
Thank you
 


Message Edited by VI logger error on 03-05-2008 04:48 AM
0 Kudos
Message 1 of 4
(3,862 Views)

Hi,

If you would like to measure the time your VI has executed you could for exemple use the tool "Profile Performance and memory". You find it under Tools>>Profile>>Performnce and memory

If you would like to measure the time of a loop iteration for exemple, you can use the structure Timed Loop and use the output "Iteration duration" from the output node. See tha attached VI.

If you would like to use a while or for loop and measure the iteration time you could program it by using a shift register and for exemple Get Date/Time in Seconds.vi, take a look at the attached exemple Elapsed time.vi.

I'm not exactly sure what you mean by a second of indicators and controls but maybe it's a local variable you mean? Right click on the control and choose Create>> Local variable.

I hope this helps!

Regards,
Caroline Edenholm
Applications Engineer, National Instruments
Download All
0 Kudos
Message 2 of 4
(3,850 Views)
A common way to measure the duration of a piece of code or sub-VI is shown in attached VI.
0 Kudos
Message 3 of 4
(3,847 Views)
Never, ever, create a local variable just to avoid wiring. That is just bad programming. Take a little time and make your wires neat, use subVIs, etc.
0 Kudos
Message 4 of 4
(3,839 Views)