LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for suggestions to make this VI more efficient

Hello, 

 

I am looking for suggestions to help make this VI more efficient.  The VI is used in a audio acquisition program that is configurable to aquire data on up to 32 channels.  The more channels I add the more likely it is to error due to filling up the buffer.  Any help would be appreciated.

 

Thanks

Download All
0 Kudos
Message 1 of 6
(2,493 Views)

What are you doing with this data once this loop is complete?

 

Are all of these channels on the same DAQ board?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,454 Views)

This VI is part of a much larger project but is the most called.  After the loop is complete the output data gets sent off into another file writing loop and to another live processing loop.  The channels are not required to be on the same DAQ board or even in the same chassis (different tasks).  

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

Question.  The channel config cluster is 2D, WHY?  The values in the arrays of indices must almost have to be unique (Or you are losing data) 

 

So sorting inside the acquisition loop on the large sets of data is probably un necessry 

Capture.PNG

The lower section still sorts the data in a loop but uses that super new concatonating tunne and a parralel for loop to speed things along.

 

The top section shoews you how to sort your tasks so the data comes out sorted and would be prefeable   

 

Without knowing more about your tasks (like # of channels in each) its hard to see the right ordering so excuse the final tunnel modes on both loops I think you want concatinating tunnels there too


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(2,425 Views)

I had the main for For loop labeled incorrectly, it cycles through each task/device not each chanel.  This could lead to some confusion.  The inside for loop cycles through each channel within each task/device.  The intent here is to have a flexible data acquistion program that can handle multiple tasks/devices at the same time.  

 

To test this I have been using 9 daq channels on 2 devices (1-9172 CDAQ Chassis with 2-NI 9229 cards and 1-NI9178 Chassis with 1-9215 card).  The DAQ channels don't always need to be in order either (example: Dev1/ai0, Dev2ai0, Dev1/ai1, Dev2/ai1,....).  This type of setup requires 2 tasks, and is completely configurable, if desired another chassis can be added at any time.   

 

The inputs are as followed:

# Channels = numeric = This input is the total number of channels across all devices/tasks.

Channel Index per Device = Array of Cluster of array of indices =  Each device/task adds another element to the array of cluster, each array of indicies contains location information where each channel is on a specific device in the output data array. 

DAQmx Tasks = One element will be added for each device/task.  

 

I have updated the VI.

 

Thanks,

0 Kudos
Message 5 of 6
(2,410 Views)

Hi.

 

Are you only using DAQmx Read in your code? If you are looking to speed up your process i would recommend looking in DAQ Task State Model. This documents might help you to get started.

 

http://www.ni.com/white-paper/3021/en/

 

http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/ 

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