LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Program slow down / problem of memory optimization

hi all,

 

Here is my problem. I am using Labview 2011 and a NI acquisition board. In attachment are simplified VI codes I implemented to acquire analog signal and process the data. The main_VI.vi starts the RUN VI that performs data acquisition and data processing. In the RUN VI, I implemented a state machine because there are many sequential steps. The acquisition is done many times (see max iteration value) and for each acquisition, there is a processing. I used a queue structure to send data for processing in parallel. I also use a in-place element structure to manage the array.

For real data acquisition (from NI board), the program slows down after hundreds of iteration and when I exit the program, it seems the VI has to free memory because it takes few minutes to close the VI.

My questions are:

-       Is the state machine structure properly implemented?

-       Is the queue strategy optimal to do parallel processing?

-       Is the use of in-place element structure properly implemented in my case, and is it needed for 1D array with a size of 4000 to 20000 points?

 

Thank you for your help/suggestions.

 

Cedric

Download All
0 Kudos
Message 1 of 3
(2,335 Views)

here is the 'Process_data.vi'.

0 Kudos
Message 2 of 3
(2,333 Views)

Hello Cedric,

 

I noticed that in your "RUN.vi" you are calling the "acquisitions_data.vi" iteratively in a For Loop.  Everytime that For Loop iterates, you are creating the Task, running the acquisition, then closing the Task.  You don't need to create and clear the Task over and over again like that.  Instead, create and configure the Task outside of the for loop.  This way when you get inside the for loop, use the "DAQmx Start Task.vi" to start the task, perform the read using the "DAQmx Read.vi", then use the "DAQmx Stop Task.vi" to stop it.  Outside the for loop you can place the "DAQmx Clear task.vi" to clear the references.

 

Perhaps this will help with your performance.

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,279 Views)