Example Code

Get cDAQ Module Types in C# .NET

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)
  • Other

    Software

  • Measurement Studio

    Driver

  • NI DAQmx

Code and Documents

Attachment

Download All

Overview

This example programmatically identifies the model of each module in a chosen cDAQ chassis.

Description

The code uses the DaqSystem class to load the chassis as a Device object.  Then, a foreach loop iterates through the list property ChassisModuleDeviceNames.  Each module is loaded as a Device object using the DaqSystem class.  The ProductType property of the module object returns the string that indicates the module type, which is added to the list of modules.

Requirements

Software

  • Measurement Studio 2010 or compatible
  • DAQmx Driver 9.1.5 or compatible

Hardware

  • cDAQ chassis with modules (physical or simulated)

Steps to Implement or Execute Code

  1. Extract the ZIP file and open GetChassisModulesType.sln
  2. Refresh the NationalInstruments.Common and NationalInstruments.DAQmx references
  3. Click Start to run the code
  4. When the List Chassis Modules prompt appears, select the desired device from the Chassis dropdown list.  The display will populate with a list of modules installed in the selected chassis
  5. Close the prompt to stop the code

Additional Information or References

Form

List Chassis Modules.png

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

National Instruments

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

Contributors