06-16-2018 06:08 PM
Hello all,
I'm using an NI USB-6210 DAQ to collect analog samples for an FFT and would like to increase the number of samples I can collect per channel so I can increase the speed at which I can update the FFT. I'm not sure if this is a hardware limitation that I'm misunderstanding, a limitation in the software, or if it is an issue with my code.
I cannot get the data collected with the `nidaqmx` module in Python to exceed a read of 1000 samples per channel, however the manual for the USB-6120 states it can handle 4095 samples in the FIFO. Is this 4095 bytes, so it can only hold ~1000 32-bit floats?
Below is my simplified code and it's output.
import numpy as np import nidaqmx task = nidaqmx.Task() task.ai_channels.add_ai_voltage_chan("Dev1/ai0") task.timing.cfg_samp_clk_timing(10000) data = task.read(number_of_samples_per_channel=-1) print("len -1: " + str(len(data))) data = task.read(number_of_samples_per_channel=4000) print("len 4000: " + str(len(data))) data = task.read(number_of_samples_per_channel=250) print("len 250: " + str(len(data))) task.close()
Output:
len -1: 1000 len 4000: 1000 len 250: 250
Any assistance or thoughts would be greatly appreciated!
Solved! Go to Solution.
06-18-2018 09:58 AM
You aren't giving a sample_mode (default FINITE) nor a samps_per_chan (default 1000) in cfg_samp_clk_timing, so you are getting those defaults. From a finite 1000-sample acquisition, you can only read at most 1000 samples.