06-28-2018 10:04 AM
Hi, I wanted to know what is the channel configuration (diff, RSE, NRSE) of the channel I'm working, 'Dev1/ai0'. I want to do this all in python.
On the documentation under the nidaqmx.task.ai_channel there is something called ai_term_cfg
so I suppose thats how you get it, but I don't understand how you use it. I supose you have to create an instance of: nidaqmx._task_modules.channels.ai_channel.AIChannel(task_handle, virtual_or_physical_name), but I don't know what task_handle is, and I've looked a lot a didn´t find anywhere explaining it.
Thank you
01-29-2019 10:18 AM - edited 01-29-2019 10:21 AM
Just been working on this same problem, and I know this answer is too late for the OP, but here's how to do this (it may help someone in the future):
First of all, when you import nidaqmx, also import the TerminalConfiguration constants file:
import nidaqmx from nidaqmx.constants import TerminalConfiguration
Then create a task/channel object as follows (assumes your NIDAQ is "Dev1" in MAX, and the channel is analog-in 0). The "print(ai_channel.ai_term_cfg)" line below then shows how to read back the configuration of your channel, before you do anything to set it.
with nidaqmx.Task() as task:
ai_channel = task.ai_channels.add_ai_voltage_chan("Dev1/ai0")
print(ai_channel.ai_term_cfg)
For example, you may see something like:
TerminalConfiguration.DIFFERENTIAL
To change the terminal configuration to, for example, NRSE, you should instead create your task as follows:
with nidaqmx.Task() as task: ai_channel = task.ai_channels.add_ai_voltage_chan("Dev1/ai0", terminal_config = TerminalConfiguration.NRSE)
11-07-2022 09:56 AM
Hey,
bit late to the party but how can I configurate the Output Terminal to RSE? I know that it is possible to do it in Labview, but i can not find the method in Python.
For Input ist is:
11-07-2022 11:10 AM
@jo_dkt wrote:
Hey,
bit late to the party but how can I configurate the Output Terminal to RSE? I know that it is possible to do it in Labview, but i can not find the method in Python.
For Input ist is:
task.ai_channels.add_ai_voltage_chan("Dev1/ai0", terminal_config = TerminalConfiguration.DEFAULT)But for Output:task_2.ai_channels.add_ao_voltage_chan("Dev1/ao0", terminal_config = TerminalConfiguration.DEFAULT)does not work(unexpected argument)Is there an other way to do it?Thank
Do you know if your output supports different terminal configurations? it is not about software but about whether your hardware can do that.
Typically, AFAIK, none of the NI DAQs can change their terminal configuration for AO, which means either it is RSE or DIFF and cannot switch.
11-08-2022 01:49 AM
Hey Santhosh,
my task is to rewrite a script in Python. The original script was in Labview. I am using a NI USB-6366. In the original Labview script i can configurate the output terminal (see screenshot). I need to set the terminal to RSE. Because it works in Labview it should work in Python to but i am not 100% sure if my Hardware supports output terminal configurations.
Thank
jo_dkt
11-08-2022 09:39 AM
Hey,
came to the conclusion that my screenshot is wrong. But i still have to set my Input Terminal to "RSE". With my Code i get the Error ↓.
11-08-2022 10:11 AM
It looks like you have got a misunderstanding about how things were configured in LabVIEW (as per your image)
In your Python script, you've mixed and matched all the above information and ended up with errors.
11-09-2022 02:40 AM
Hey Santosh,
thanks for the reply, My Labview screenshot is wrong, I can ignore the output terminal configuration. My Problem is now that i get the mentioned error when setting the AI inputterminal to "RSE".
Do you have any idea, how to solve it?
Thanks,
jo_dkt
11-09-2022 10:20 AM
@jo_dkt wrote:
Hey Santosh,
thanks for the reply, My Labview screenshot is wrong, I can ignore the output terminal configuration. My Problem is now that i get the mentioned error when setting the AI inputterminal to "RSE".
Do you have any idea, how to solve it?
Thanks,
jo_dkt
Yes, of course, please refer to your device specification to check if really supports "RSE" terminal configuration, I would bet that your device supports only "Differential" input configuration. BTW, what is your device model?
The error text is pretty clearly saying that your device supports only "Differential" as the input configuration.
11-10-2022 12:57 AM - edited 11-10-2022 01:00 AM
Hey Santhosh,
thanks for the reply. I am using a NI USB-6366. I guess you are right and the Hardware does not support RSE. We still found a way by wireing the AI0- to the AI GND channel. So we did the same thing but not in the software but in the hardware.
Thanks for your replys again, they were very helpfull.
jo_dkt