LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

indicator resets back to default

Hiya,

I have the following vi and want to change everything within the while loop into a subVI. The thing is that when I do this, I get a warning that the code contains an indicator.
When I ignored it and ran the subvi from my main application, the indicator (PEAK TO PEAK) resets back to zero every time the subvi has been called.

Is there a way how to overcome this, i.e. remember the last value stored until the subVI is called again?

Cheers
0 Kudos
Message 1 of 3
(2,543 Views)
You need to put the peak-to-peak indicator outside the case structure so it gets updated every loop iteration. To retain the values for iteration that currently don't update the indicator, use a second shift register across the while loop which also goes throught the case structure.
In the TRUE case, the result of the division is wired to it's output tunnel. In the FALSE case, the output of the left shift register is simply wired across the case structure, retaining the old value. From the indicator, the wire continues to the new shift register on the right.
0 Kudos
Message 2 of 3
(2,543 Views)
Your solution worked right away, thanks a bunch!
0 Kudos
Message 3 of 3
(2,543 Views)