01-21-2014 11:16 AM
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
01-21-2014 11:16 AM
here is the 'Process_data.vi'.
01-22-2014 04:30 PM
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.