Creating Virtual Channels with the API

NI-DAQmx Key Concepts

Creating Virtual Channels with the API

The following example illustrates the difference between physical and virtual channels and demonstrates how to create virtual channels with the API.

Problem

Create an NI-DAQmx virtual channel to measure temperature in the range 50° C to 200° C using a J-type thermocouple wired to channel 0 on an M Series device configured as Device 1. Use LabVIEW or LabWindows™/CVI™ to write your application.

Solution

  1. Call the AI Temp TC instance of the DAQmx Create Virtual Channel VI in LabVIEW (DAQmxCreateAIThrmcplChan function in LabWindows/CVI).
  2. Use Dev1/ai0 as the physical channel on the device to which the thermocouple signal is connected.
  3. Specify myThermocoupleChannel as the name to assign to your virtual channel.
  4. Select the appropriate values for the thermocouple type and range inputs. NI-DAQmx applies these attributes to the virtual channel.

You have now created a virtual channel.


See Also

Choosing Whether to Use the API or the DAQ Assistant

Device-Specific Physical Channels

Device-Specific Internal Channels