LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I make vi reuse previously generated data?

Solved!
Go to solution

attached VI is just a simple example for my problem. I want to generate some data (or read it in through some shared variable, etc, etc) and create some statistics on this data. In this example, a histogram and the mean value.

Now, if I stop the VI & restart it again, the first time I generate a new data point, all the old data will be deleted from the graph and the indicators. I want to modify my program, so it will actually still see all the data that I've accumulated before in the array.

 

I know how to do this for example in matlab:

output = myfunction(output)

 

so when I call this function the first time "myfunction()" it will generate the output array which I can then pass again on the next call so that the previously generated data will be used. 

 

So how do I do this in Labview?

0 Kudos
Message 1 of 3
(2,799 Views)
Solution
Accepted by topic author kandreas

Do a search for functional globals, which is based on using an uninitialized shift register for a while loop. You basically already have this if you simply delete the array constant that's initializing the shift register holding the data array. This is a technique that was used before global variables were introduced. It's an old technique, but it's highly effective, and the basis for Action Engines. Jim Kring has suggested a no-loop version for LabVIEW 8.5.

 

Note: You are performing a comparison on floating point values. As has been pointed out many times on this forum, this is doomed to fail because of the way floating point numbers are stored in computers (this has nothing to do with LabVIEW). 

Message Edited by smercurio_fc on 01-04-2009 10:21 AM
Message 2 of 3
(2,795 Views)
Message Edited by Adnan Z on 01-04-2009 08:24 PM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 3 of 3
(2,791 Views)