LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reset timer in a running vi

Solved!
Go to solution

Hi,

I have used 2 time elapsed timers inside my data acquisition loop to acquire digital signals just between lets say 11s and 11.05s. The vi works properly if I stop the vi and run it again but the problem I have is, this vi is a subVI and since  it is called from another vi , the timer will not reset when it is called again so the elapsed time doesn't start from zero . Could you please let me know how can I reset the timers when this vi is called as a subVI.

Thanks

0 Kudos
Message 1 of 4
(3,306 Views)

Hi !

Have you tried to make Elapsed Time 1, and Elapsed Time 2, input terminals of your SubVI ?? so they will be refreshed every time you call it in the main VI ...

0 Kudos
Message 2 of 4
(3,292 Views)

Hi, Do you mean I use Reset terminal as as input terminals of my subVI. I have tried that but the problem is when I change the state to be true from my calling vi then the counters don't stop counting since the reset terminal is always true inside the loop

0 Kudos
Message 3 of 4
(3,284 Views)
Solution
Accepted by tintin_99

Hello tintin,

 

To get the behavior (I think you) want, you'll need to use some sort of logic to reset the express VIs when you want to- I would suggest using the loop's iteration counter (i) and an Equal to Zero? Comparator function to reset the timer only on the first iteration of the loop.

 

Regards,

Tom L.
0 Kudos
Message 4 of 4
(3,274 Views)