LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Constantly add data to large 2D array

Solved!
Go to solution

Hi I am having alot of trouble dealing with some large arrays. What i am trying to do is create a program that monitors 23 inputs from a cRIO controller. Here is the program flow:

1. program starts and collects 1 sample/second from each input and put in a 2D array that has 23 columns and 10 rows

2. Only collect 10 samples, constantly replace samples in that array.

3. once a threshold is crossed from any of the inputs take the previous array and add it to a different 2D array that has 23 columns and 360,000 rows.

4.once that array is inserted continuously add data from each input to the new array at a rate of 100 samples/sec.

5. the large array has 360,000 rows because the program needs to be able to record data for a full hour if necessary.

 

I was using 23 separate arrays and that worked OK but It was much to inefficient and the program was to slow. I can't get the data to go into the array right and I am getting pretty frustrated so any help will be much much appreciated. Thanks,

 

Adam

0 Kudos
Message 1 of 4
(1,441 Views)

Please post your code (VI+screen shot) so we can see why the data isnt "going into the array right" and help you out Smiley Happy

 

Why do you say that the large array already has 360,000 rows already? Are you initializing the array size or are you allowing labview to expand the array as needed?

 

Yea once you post your code I'm sure we can help you. Your program seems pretty straight forward and I'm sure we could help you out.

 

 

 

 

---------------------------------
[will work for kudos]
Message 2 of 4
(1,417 Views)
Solution
Accepted by topic author Engineer@Universal

At a minimum I would initalize your arrays to the largest possible size you may encounter. When adding data use the Replace Array Subset to update the array with your new data. Also, I would place these arrays into a shift register. Avoid displaying a control/indicator for the data, don't use local variables or property nodes to access the data. either.

 

Also, do you need to have all the data in the application while it is running? Can you use running averages or other methods to reduce the amount of data you need to keep in memory? Can you possibly store the data to disk and only keep a portion of it in memory and only read the complete data when you need it?



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 4
(1,409 Views)

I am initializing the array to 23 columns and 360,000 rows because each input will be aquiring data at a rate of 100 samples per second for a maximum of 1 hour and there are 3600 seconds in an hour. I got an idea though so I'm going to see if i can fix this myself before I post any code. But right now I am using 1 2D array and building an array of all the inputs and using replace subset to insert that array into the large one.

0 Kudos
Message 4 of 4
(1,381 Views)