This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

NI-DAQmx Syntax for Specifying Physical Channel Strings

Updated Jul 31, 2023

Reported In


  • NI-DAQmx

Issue Details

I want to specify a single channel or expand for multiple channels for my DAQ device using NI-DAQmx. I want to acquire data from two or more different channels simultaneously. What is the syntax for physical channel strings in DAQmx?


Physical Channel Names

Physical channel names consist of a device identifier and a slash (/) followed by a channel identifier. For example, if the physical channel is Dev0/ai1, the device identifier is Dev0, and the channel identifier is ai1. MAX assigns device identifiers to devices in the order they are installed in the system, such as Dev0 and Dev1. You also can assign arbitrary device identifiers with MAX. Device and channel identifiers are not case sensitive.

For analog I/O and counter I/O, channel identifiers combine the type of the channel, such as analog input (ai), analog output (ao), and counter (ctr), with a channel number such as the following:

For digital I/O, channel identifiers specify a port, which includes all lines within a port:

Or, the channel identifier can specify a line within a port:

All lines have a unique identifier. Therefore, you can use lines without specifying which port they belong to. For example, line31 is equivalent to port3/line7 on a device with four 8-bit ports.

Physical Channel Ranges

To specify a range of physical channels, use a colon between two channel numbers or two physical channel names:

For digital I/O, you can specify a range of ports with a colon between two port numbers:

You also can specify a range of lines:

You can specify channel ranges in reverse order:

Physical Channel Lists

Use commas to separate physical channel names and ranges in a list as follows:
Dev0/ai0, Dev1/ai0:3, Dev1/ai6
Dev0/port0, Dev0/port1/line0:2

Additional Information

This information is also located in the DAQmx help file. You can launch this from either:
  • Windows Start Menu » Search: NI-DAQmx Help or
  • in NI MAX, go to menu Help » Help Topics » NI DAQmx » NI DAQmx Help.
Once inside help, it will be in the section NI-DAQmx Key Concepts » Channels and Tasks in NI-DAQmx » Channels: Physical, Virtual, Local Virtual, and Global Virtual » Physical Channel Syntax.

When using a comma-separated list, ensure that you're specifying the device's name in each entry in the list so that DAQmx knows which device you're referring to in each entry, since there may be more than one channel with the same name (for example, "ai0") in your system.