Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Determine DAQmx Device Name when Deploying Executables

Overview

This example uses a DAQ System Property node to return an array containing the DAQmx resource names of all of the hardware on the computer.

 

Description

When preparing a program to be built into an executable meant for deployment, it may be advantageous to include code that will detect all devices on the deploymnet machine, determine which one is the correct device, and then output it's DAQmx resource name for use within the exectable. This will cut down on confusion for any operators who may be running the executable and unfamiliar with LabVIEW or the DAQmx device resource naming paradigm. 

The example program downloadable here uses a DAQ System Property node to return an array containing the DAQmx resource names of all of the hardware on the computer. It then uses a for loop to interate through each resource name, obtaining the Product Type and Serial number of that specific device. These can be compared to the desired value for the device that was deployed with the code. When a match is found, the for loop is exited and the DAQmx Device name is output for use in the acquisition code.

 

Requirements

Software

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

Hardware

  • NI Multifunction DAQ Device

 

Steps to Implement or Execute Code

 1. Enter the Product Type of the device you want to acquire from, ex USB-6009 or PXI-4472

2. Enter the channels of the device you want to acquire from, beginning with a "/", ex "/ai0:3" to acquire from analog input channels 0, 1, 2, and 3.

3. Configure the Maximum and Minimum expected values of the acquisition, as well as the desired Timing Properties.

4. Run the VI. It will now search the system for the matching product and acquire on the configured channel

 

Additional Information or References

 

 

 

 

Identy BD.png

 

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

 

Mallori M
National Instruments
Sr Product Manager, Customer Proficiency

ni.com/training