08-20-2019 01:10 AM
I'm trying to work out how to tell a USB-6216 to change an analog input resolution via Python using nidaq-mx library. Does anyone know how to do this? The documentation for nidaqmx is completely opaque on this aspect.
Thanks /A
08-20-2019 07:15 PM
Hi AdMico, I don't have much experience in Python but can answer your question.
USB-6216 has 16bit ADC and you can make smaller the resolution by configuring "AI Range".
Case1:
Range = +/-10V
Resolution = (+10-(-10))/2^16
Case2:
Range = +/-5V
Resolution = (+5-(-5))/2^16
08-20-2019 08:50 PM
Thanks, but that's the problem, I know that bit, I just can't find in the nidaq-mx documentation where it tells you how to issue that command via Python. Is there a nidaq-mx support or board that I should post this to instead?
08-20-2019 11:28 PM
Excuse me, I may not understand what are you looking for.
You can configure the range with method below.
ni-daqmx provides the support and you can configure it on all NI DAQ devices.
Do I have any misunderstanding?
08-21-2019 03:55 AM
Sorry, but that's still not helping me much. It has a command with 15 million options, and no information about how to structure the command to set any of them. It's like documentation that was written by an engineer with no idea how unintelligible it's going to be to someone who isn't an expert already on the system.
Is there something, somewhere, that tells me in an understandable way how to implement a change in *any* of those 15 million options there? I can probably work from one to any of the other 14,999,999 options, but my problem is, what's on that page, is completely useless in terms of someone slightly new to the software knowing how to actually use it.
/A
08-22-2019 10:41 PM
Hi AdMico, the input range will automatically adjusted based on the expected max and min value specified. For example, if you have the code:
import nidaqmx task = nidaqmx.Task() task.ai_channels.add_ai_voltage_chan("Dev1/ai0", min_val=-2, max_val=7)
The AI range will change to ±10 V, which is one of the supported range for USB-6216
But if you still want to manually change the range. You can use the code below to configure ai_rng_high property:
import nidaqmx task = nidaqmx.Task() a = task.ai_channels.add_ai_voltage_chan("Dev1/ai0") a.ai_rng_high = 10.0