Using NI MAX
- Open NI MAX and select your device from the Devices and Interfaces drop-down menu.
- Click on Create Task... from the toolbar at the top of the window. Then, Acquire Signals>>Analog Input>>Voltage.
- Select the device channels to be included in the analog input task by clicking the first channel, holding the shift key, and then clicking the last channel in your list. It is also possible to select them individually by holding the control key and then selecting the channels one by one. Click Next >.
- Name the voltage task and click Finish.
- Configure the individual voltage ranges in the configuration panel by clicking each channel and setting the signal input range, as many times as required.
Note: For DAQmx tasks configured in NI MAX, NI recommends the creation of a backup of this configuration for later use and changes. Please, refer to this article for guidance to
Export/Import the System Configuration in Measurement & Automation Explorer (MAX).
In LabVIEW, the task can be directly wired to
DAQmx Timing VI (after being dragged and dropped from NI MAX to the block diagram) as shown below. The DAQmx Create Task and DAQmx Create Virtual Channel VIs are not necessary because the task and channels have already been created in MAX.
Using LabVIEW:
In LabVIEW, the assignment of different input voltage ranges to analog input channels can be done by using multiple DAQmx Create Virtual Channels VIs to create different channels and set different analog input voltages for each channel or the DAQ Assistant.
Using Create Virtual Channel VI:
- Place a DAQmx Create Virtual Channel VI for each channel to be set at the same analog input range. To select multiple channels for one VI, use channel expansion.
- Connect relevant terminals for the physical channels and other settings. To set the lower boundary of the analog input range, wire a double value to the minimum value input terminal. To set the upper boundary of the analog input range, wire a double value to the maximum value input terminal.
An example of this is shown below.
Using DAQ Assistant:
- Place a DAQ Assistant in the LabVIEW Block Diagram.
- Once placed, it will begin initializing, and a Create New... window will pop up.
- The configuration process is the same as using NI MAX. Please refer to steps 3-5 of the Using NI MAX section of this article.
In LabVIEW, the DAQ Assistant can be used by itself or to
automatically generate code.
All the steps presented before can also be used for setting different voltage levels in voltage output applications when selecting voltage output tasks.
Note: Some C Series cards have defined input voltage ranges, such as +10V, +5V, +2V, and +1V. If a value for minimum and maximum is something different than these, the NI-DAQmx driver will coerce the value up to the nearest voltage range that can fully capture the input.