Change the Input Range of a DAQmx Channel While Running a VI in LabVIEW

Updated Mar 24, 2023

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base
  • LabVIEW Professional

Driver

  • NI-DAQmx

Issue Details

I have a VI using DAQmx functions for analog input acquisition. Once I start the VI, I want to change the minimum and maximum values for my input limits to take full advantage of the ADC. However, I do not want to stop my VI to do that. How can I change the minimum and maximum values for my analog acquisition without stopping the VI?

Solution

You can use a DAQmx Channel Property Node for this. Set the two properties to AI.Max and AI.Min:
 

Additional Information

When configuring the AI.Max and AI.Min properties of your channel, the DAQmx driver will select the next available range onboard your device to fit the requested values. Please note that the AI.Max and AI.Min that the driver selects might differ from those asked for.

 

Example A:

Device range: ±0.1 V, ±0.2 V, ±0.5 V, ±1 V, ±2 V, ±5 V, ±10 V.

Requested values: AI.Max = 3 V, AI.Min = -3 V.

Real range selected by the driver: AI.Max = 5 V, AI.Min = -5 V.

The driver will select the range that is able to fit the requested values without losing data. Therefore, from the possible ranges of the device, it chose the closes one rounding up.

 

Example B:

Device range: ±10 V.

Requested values: AI.Max = 1 V, AI.Min = -1 V.

Real range selected by the driver: AI.Max = 10 V, AI.Min = -10 V.

Since the device only has one input range possibility, no conditioning can be made to modify the input values to the ADC, and the driver will leave the only available configuration, regardless of the requested values.