Hi,
TL;DR: I wanted to see if someone more experienced could provide some guidance on the DAQmx functions to help me efficiently read multiple channels sequentially at the highest sampling rate achievable by a DAQ device. I would like to read 3 ms of data across 24 channels in a while loop. Each channel would be read at 250 kS/s and my program will loop through all 24 channels sequentially. My target loop rate (reading all 24 channels) is 250ms. Is this possible, or is there a better way to do this?
Hardware: NI USB-6218, Windows 10 machine
Software: LabView 2017 Full Development Edition
NI DAQmx driver: 17.0
--Detail--
I am trying to use three USB-6218 DAQs to sample and graph 72 analog inputs (RSE) at the highest sample rate the DAQ can support (250kS/s). I am doing this by creating an individual DAQmx task for each channel and splitting all tasks across the three DAQs.
The main signals of interest are on the order of 10kHz and I would like to view ~3ms of data (750 samples) on each iteration of the loop but there are aperiodic noise/dropouts that occur across all channels that are much higher in frequency (50-120kHz). I am also interested in viewing these 'broadband' noise bursts. Each graph does not need to be to be synchronous as I am hoping to capture the phenomenon on at least one channel.
The problem I am running into is that because each task is currently hardware timed, I believe that a DAQmx Start/Stop/Control call must be included in my main loop (not sure if this is true). This appears to be slowing down my acquisition significantly. I have a sequence structure that is used to time the Start Task, Read, and Control (I am using 'unreserve'), as well as the overall time required to scan through all 24 channels per DAQ. For the former, it appears each channel on average takes about 31ms. For the latter, each DAQ takes about ~800ms to run through all 24 channels.
Based on what I've read so far, it appears that software timing will not be able to achieve a resolution better than 1ms (I am on a Windows 10 machine).
What I've tried:
To try to alleviate this, I used a producer-consumer structure to queue up data but upon using the Tools->Profile->Timing it appeared that the majority of the timing overhead was coming from the DAQmx function calls, not graphing.
I then attempted adding all channels to a single task, starting the task outside of the main loop, and then using channel property nodes to select a single channel at a time per iteration of the main loop, using an incrementing counter to iterate through all 24 channels. The instance of the DAQmx Read in this case was the '1 channel N samples'. This appeared to make the loop run much faster; however, the returned data was an empty array and I got an 'ADC overrun' error.
I have not experimented with changing the convert rate/sample rate clocks, or using external clocks. I am not sure that this would be the correct way to go.
Apologies in advance for not including code - my company policy does not allow me to upload. I appreciate any help greatly!