LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with build array in a loop

I have a large Vi that acquires data from an instrument.  I am getting the data in a 1d array of a number of
 elements - that equal the number of DAQ channels that I wish to measure.

I wish to monitor the readings with every iteration of the loop.
If I put the indicator outside the main loop with an auto indexed tunnel, I am seeing all of the data only
when the loop is finished and the test is over, of course.  I am concerned that as the test grows to days and weeks
I have created a memory leak problem for myself.

As I try to build the output array inside the main loop, I wind up with either a 1d array that flashes the readings
then overwrites them in the next iteration to display the new readings, or a 2d array that flashes the 1st set of
readings than shows all zeros.

It feels like I am close, but the solution is just out of reach.  What am I missing???

Michael C. Nedrow
0 Kudos
Message 1 of 6
(3,267 Views)

How large could the array grow if the test could run for days or weeks?  Are you doing anything special with the data like writing it out to a file?  You may have to set up some special data handling situations to try to prevent large arrays.

 

As for the way you are handling the arrays now, it would be better to post a VI so we can see what you are doing before we can comment on it.

0 Kudos
Message 2 of 6
(3,253 Views)

Obviously I started with one of the examples in the lib. When I downloaded the driver..........

Attached is the problem child.........  It is a work in process.

As for how large it could get, say 40 channels of readings running for days or weeks recording a reading every 10 or 15 minutes.......that is in the future, for now it will be more like 10 to 20 channels with reading every 30 to 60 seconds running for hours..........

Any suggestions would help.

 

 

 

Thanks

 

Mike

Michael C. Nedrow
0 Kudos
Message 3 of 6
(3,247 Views)

First issue is that you are using Insert into Array.  And you are doing that to an empty array on every iteration.

 

You should be using Build Array, and a shift register to maintain the array from iteration to iteration.

0 Kudos
Message 4 of 6
(3,223 Views)

Ok, Thank You;

 

um I have apparently become stupid..................

where does this belong?

I have tried everything that I can think of and I seem to still get the same result.............

Michael C. Nedrow
0 Kudos
Message 5 of 6
(3,200 Views)

Ravens Fan

 

I did come up with a solution after all............

 

Thank You

 

I really appreciate the help and your patience

 

Thanks

Michael C. Nedrow
0 Kudos
Message 6 of 6
(3,187 Views)