LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to reinitialize an array while vi is running?

I am acquiring data using a while loop i want to know min and max values of my signal for only part of my signal. for that i am using the min and max function but this function keep the old min and max value. so my question is to know if i can reinitialyse the array on which i am looking the min and max (without interupting my while loop!)
thanks a lot
0 Kudos
Message 1 of 7
(3,372 Views)
The min/max function will operate an whatever you wire up to it. If you want the min and max of only a section of an array, use the Array Subset function to define the starting point and number of elements you want to analyse. If you say you always get an old value, you must be wiring your mix/max function before you read your new data. Make sure to wire it on the output side of your data acquisition function. It will not interrupt your while loop. You may want to post your VI to be sure.

Remember, Alliance Members are here to help. We do this stuff every day.

Daniel L. Press
PrimeTest Corp.
www.primetest.com
Message 2 of 7
(3,372 Views)
hello,
you've beeen great help, but i still have a question. Actually i am now using the the Array subset function but the probleme is i have wired the 'i' from the while loop to the array index. This is a problem because the index is moving at each iteration.
How could i fix it?
thanks
0 Kudos
Message 3 of 7
(3,372 Views)
The "i" is supposed to move. It is the iteration number of the loop that's running. Use an integer control or constant instead. That way the array index will be the same over multiple iterations of the loop.

- Dan
0 Kudos
Message 4 of 7
(3,372 Views)
for sure the iteration is moving!
I want to start on a trigger or by a boolean control the beginning of the min/max analyse, so i can't choose a constant for the array index. Actually i need to identify the iteration number when my trigger comes or when i press a control.
do you see a way to fix that problem,
thanks again
0 Kudos
Message 5 of 7
(3,372 Views)
Use a shift register to store the starting index. Wire the left side of the shift register to the False input of a Select function (the big triangle in the Comparison palette). Wire your Boolean trigger to the middle (make sure your boolean action is latched when released). Wire the "i" to the TRUE input of the Select. Use the output of the Select as your starting index.

Now, any time you hit the trigger button, your starting index is updated.

- Dan
0 Kudos
Message 6 of 7
(3,372 Views)
Photon Dan, you are making quite an impact on these Discussion Forums! Thanks for all the time and efforst you spend here. It is greatly appreciated by all of us.
J.R. Allen
0 Kudos
Message 7 of 7
(3,372 Views)