From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble Using USB-6009 w/MATLAB Data Acquisition Toolbox and NI-DAQmx

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!

0 Kudos
Message 1 of 2
(2,319 Views)

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

https://www.mathworks.com/matlabcentral/answers/153322-how-to-acquire-and-generate-data-using-ni-daq...

 

Acquire Data Using NI Devices

https://www.mathworks.com/help/daq/examples/acquire-data-using-ni-devices.html

0 Kudos
Message 2 of 2
(2,280 Views)