Academic Company Events Community Support Solutions Products & Services Contact NI MyNI
17 ratings:
 3.70 out of 5   

NI-DAQmx Syntax for Specifying Physical Channel Strings



Primary Software: Driver Software>>NI-DAQmx
Primary Software Version: 7.4
Primary Software Fixed Version: N/A
Secondary Software: N/A

Problem:
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?

Solution:
This information is located in the DAQmx help file, and is included here as a reference.

Physical Channel Syntax
Use this syntax to refer to physical channels and groups of physical channels in NI-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:

    ai1
    ctr0

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

    port0

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

    port0/line1

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:

    Dev0/ai0:4
    Dev0/ai0:Dev0/ai4

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

    Dev0/port0:1

You also can specify a range of lines:

    Dev0/port0/line0:4
    Dev0/line0:31

You can specify channel ranges in reverse order:

    Dev0/ai4:0
    Dev0/ai4:Dev0/ai0
    Dev0/port1/line3:0

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

Related Links:
KnowledgeBase 3GL8JLBP: Why Do I Get "Error -200220: Occurred at Device Identifier is Invalid"? KnowledgeBase 2X8D7F5Z: How Do I Select More Than One NI-DAQmx Channel in LabVIEW?
KnowledgeBase 5QJHRL2P: Easily Synchronize and Trigger NI-DAQmx with Channel Expansion
White Paper: Channel Expansion Explained

Attachments:





Report Date: 04/19/2005
Last Updated: 09/29/2017
Document ID: 3KICS4BC

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit