LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays

Solved!
Go to solution

I am attempting to save data from a sensor to an array but I am having no luck. While loops graphs just fine, but I also want the sensor data to be saved to an array but have no idea where to start. 

0 Kudos
Message 1 of 3
(1,984 Views)
Solution
Accepted by topic author pvally

You're not saving anything. You are putting the contents of the array into the array indicator every cycle of the loop. I think that you're wanting to add the data to the previous data. This can be done with either a feedback node or a shift register (you should read up on dataflow). I would not recommend this, however, as you're going to be taking more memory on every iteration of the loop. Eventually you will run out of memory. It would be better to send the data to another loop via a queue (or channel) and save the data to a file.

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

I presume the important question to ask in this case is not how to save data into an array, but WHY to save the data into an array. What will happen after this step? Are you logging that into a file? Performing some analysis with it? Just displaying it in the front panel? The technique to use will depend on the end result.

 

I agree with johntrich1971 in perhaps moving to a Producer-Consumer pattern, using shift registers, or auto-indexing the data in the loop's tunnel. I also share the memory limit concern in the two latter cases.

 

All the best,

0 Kudos
Message 3 of 3
(1,946 Views)