Programmatically Detect DAQ Device Information in Text-Based Environments

Updated Apr 5, 2023

Reported In

Software

  • LabWindows/CVI Full
  • LabWindows/CVI Base

Driver

  • NI-DAQmx
  • NI-DAQmx Runtime 17.6

Programming Language

  • C
  • C++

Other

Visual Studio

Issue Details

I am building an application and do not want to rely on specific MAX configurations for my application to run correctly.  I would like to programmatically obtain information about the devices in my system, such as chassis number, slot number, device name, serial number, etc. How can I do this using text-based function calls?

Solution

There are several DAQmx functions for programmatically determining device information:

Product Type: This will return the product type of the device, such as PXI-6259
DAQmxGetDevProductType(const char device[], char *data, uInt32 bufferSize);

Serial Number: This returns the serial number of the device.
DAQmxGetDevSerialNum(const char device[], uInt32 *data);

Device Names: This property will return a comma-delimited list of all of the devices installed in the system.
DAQmxGetSysDevNames(char *data, uInt32 bufferSize);

Chassis Number: This property returns the number of the chassis the device is in.
DAQmxGetDevPXIChassisNum(const char device[], uInt32 *data);

Slot Number: This property returns the slot number the device is in.
DAQmxGetDevPXISlotNum(const char device[], uInt32 *data);
 

Additional Information

See the NI-DAQmx C Reference Help document for more information. This document can be found at Start » Programs » National Instruments » NI-DAQ » NI-DAQmx C Reference Help.

Using NI-DAQmx Runtime will require you to use these functions to correctly identify your devices, as NI MAX is not included with the installation.