Example Code

DAQmx AI read based on Device Serial Number

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 VI allows the user to read AI from a device that has a known serial number regardless of device name changing or for example in a CompactDAQ changing slot.

 

Description

This example shows how to read a DAQmx AI channel based on the device's serial number, so in case the user has a system where devices can change slots in a cDAQ (in case of C Series modules for example), the device is changed from USB port or simply change device names, the acquisition will still work correctly. This example also contains a VI in which the user can actually see which devices are present at the moment in his system and their corresponding serial numbers, so he can begin to work with the examples with no delays.

 

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. Obtain the desired device serial number by using FindSerialN.VI (subVI)
2. Insert the serial into the Serial Number text field.
3. Select the AI channel to read, rate and samples per channel
4. Start the VI
5. Stop the VI. 

Additional Information or References

搜狗截图17年01月07日1930_12.png

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

 

 

 

Francisco Arellano

National Instruments Mexico
Field Systems Engineer - Energy Segment
www.ni.com/soporte

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

Comments
Todd S.
NI Employee (retired)
on

thanks for posting.  please add "LabVIEW" to your tags and rename your attachment to include the LabVIEW version.  "_lvXX.vi" would be fine.

Todd S.
LabVIEW Community Manager
National Instruments