From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Programmatically Select DAQmx Physical Channels for Task Configuration

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview

This example demonstrates a programmatic method for selecting available devices on a system for DAQmx task configuration.

  

Description

Employing methods to programmatically select available devices and physical  channel types, allows developers to avoid User input for application deployment. The example below uses the DAQmx System Property Node to isolate the first available Digital Input (DI) lines, and forwards a selected subset for DAQmx Task configuration. This example is meant to be demonstrative of the available System and Device properties that may programmatically be extracted. Further logic may be implemented to isolate specific device names, bus types, or additional I/O types.

 

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device with at least one counter

Steps to Implement or Execute Code

1.Download the attached VI.
2. Set the DAQ device.
3. Run the VI.

 

Additional Information or References

 搜狗截图17年01月07日1511_4.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Patrick Corcoran
Application Engineering Specialist | Control
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Fraktur
Member
Member
on

Demonstrates the DAQmx System and DAQmx Device realtionship very well. A link to this in LabVIEW Help would be nice.

sha4790
Member
Member
on

This was useful but, the output of the subarray function will not get into the input of DAQmx-create-channel.vi function...

The required input format is as given on this link: http://zone.ni.com/reference/en-XX/help/370466AC-01/mxcncpts/physchannames/

So what is required to be done and I cannot find a way to do is:

- the output of this VI is of the 1D array of physical channels format.

- the required input format for DAQmx task configuration - even for multiple channels is "physical channels" and all the channel names have to be listed as given on the link towards the end.

The out to input incompatibility is what i want help for...