05-16-2023 10:56 PM
Hi
I have a Python data acquisition project using NI-DAQmx. The project uses one ao and two ai channels at the same time at 200kHz. I would like to reduce the noise level of the measured signal.
When I set the ai lowpass filter to true for my NI 6281 device, it gives me this warning message:
"Error -200038
Data may be invalid because the settling time of the enabled filter exceeds the period between two conversions on the analog-to-digital converter (ADC) for a task with more than one channel. Disable the filter by setting AI Lowpass Enable to false, increase the time between two ADC conversions by reducing the AI Convert Rate, or acquire data from only one channel in the task."
The filter also makes the measured data unusable at the moment, perhaps that's what "Data may be invalid..." referring to.
Looks like I have three options to deal with this problem.
1. Disable the filter
2. Reduce the AI Convert Rate
3. Acquire data from only one channel in the task
I don't want to disable the filter or acquire data from only one channel, so I left with the second option.
But I am not sure how am I supposed to "increase the time between two ADC conversions by reducing the AI Convert Rate" in Python
Also, is it possible to adjust the settling time?
This post might be similar to
https://forums.ni.com/t5/LabVIEW/Onboard-Filtering-on-PCI-6284/m-p/702850#M321979
But that was from 15 years ago, and I'm using a different API.
I attach the daq function of the project.
Thanks
05-17-2023 08:38 AM
nidaqmx python is a wrapper library on the DAQmx C API. You can find the equivalent property of ai_conv_rate in nidaqmx.task.timing — NI-DAQmx Python API 0.7 documentation
Basically, you can use
05-17-2023 09:24 AM
Thank you, but the problem remains. I print(task_read.timing.ai_conv_rate) out, and I notice it's set to 400000 automatically, and that I believe is way above the settling time requirement right? Still, show me the warning.
If I set task_read.timing.ai_conv_rate to a higher value like 550000, I have an extra warning -
"Warning 200011
Clock rate specified is so high that it violates the settling time requirements for the acquisition.
Reduce the clock rate, or the accuracy of the measurement might be compromised."
If I set task_read.timing.ai_conv_rate to a lower value like 200000, I have an error-
"Sample rate exceeds the maximum sample rate for the number of channels specified. Reduce the sample rate or the number of channels. Increasing the convert rate or reducing the sample delay might also alleviate the problem"
Is it possible to adjust the sample delay as the error message suggests? If so, how should I do it?
05-17-2023 10:21 AM
I am afraid that the maximum sampling rate you can use for multichannel measurements with the low-pass filter enabled is only 20kHz (50us). And this is an aggregate value. You can only use 10kHz for 2 channels.
You can only use 200kHz for two channels (400kHz aggregate, which is below 2us of settling time) with the filter disabled.