I would like to change the analogue output voltage limits of my DAQ device using Python DAQmx API. What functions do I need to use in my script to achieve this?
In order to change the analogue output voltage limits of your DAQ device, you need to make use of the following functions from the nidaqmx.task.ao_channel Python DAQmx API :
These float-type functions specify the maximum and minimum values you expect to generate with your DAQ device.
Critically, you must ensure you incorporate "all" before ao_max and ao_min. This is to ensure you specify a channel object that represents the entire list of virtual channels on this channel collection .
The following is a basic example of using an nidaqmx.task script which is used to change the voltage limits of an SC Express device to a maximum and minimum voltage limit of +/- 16V:
from nidaqmx.constants import AcquisitionType, Edge
with nidaqmx.Task() as task:
task.ao_channels.add_ao_voltage_chan("<Your Device Name>/<Channel Name>")
task.ao_channels.all.ao_max = 16
task.ao_channels.all.ao_min = -16
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.