03-01-2019 06:34 PM
Hello,
I am currently trying to perform both analog output and analog input using the NI-DAQmx drivers for the MATLAB Data Acquisition Toolbox. However, it seems that it is very slow. We need to be able to output a sine wave, then measure a voltage at a speed of around 100Hz. However, when I use outputSingleScan and then inputSingleScan, the best it seems to do is about 40 Hz.
If I just do the outputSingleScan without the inputSingleScan, it looks like it can achieve 1 kHz. I assume that it is the successive calls cause the slowdown. Is this a limitation with the hardware? Or, is it a limitation because we are using MATLAB? Would we be able to achieve the speeds we need with the USB-6009 if we were using C? Or, would it require different hardware?
Any information would be useful.
Thanks!
03-04-2019 04:30 PM
Hello, Nyamaekye,
I checked the NI USB-6009 User Guide and the maximum AI sample rate is 48 kS/s. According to this, you can use the sample rate you mentioned. Analog inputs and outputs are independent processes, so there shouldn't be a hardware limitation. What could be happening is a limitation when implementing the software, because the hardware does allow it.
You can verify this with community examples (I'm linking some below):
How to acquire and generate data using NI DAQ simultaneously on a continuous basis
Acquire Data Using NI Devices
https://www.mathworks.com/help/daq/examples/acquire-data-using-ni-devices.html