Example Code

Code for downloads-USB 6211

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.

    Software

  • LabVIEW

    Driver

  • NI-DAQ™mx

Code and Documents

Attachment

Description

Overview

These are the example VI's developed in the USB-6211 videos.

Description

  • analoginput.vi - This VI shows how to continuously acquire analog input voltage from two channels and displaying them in a graph in the front panel in LabVIEW.
  • analoginputwithalarm.vi - This VI acquires one analog signal voltage from a microphone, performs analysis to convert signal into frequency domain, then compares predominant value against a threshold level and turns "on" an LED connected to a digital output line to generate a digital alarm.
  • analogoutput6211.vi - This VI generates two waveforms and outputs thru the two analog output channels of the USB-6211 connected to two LEDs.
  • triggereddatalogging6211.vi – This VI acquires analog input voltages coming from a potentiometer and uses a switch connected to digital input line to trigger the logging to file and show the saved data in a graph in LabVIEW
  • eventcountingwith6211.vi – This VI uses the counter input from the USB device to count events or pulses coming from a hall-effect sensor powered by the 5V of the USB device.
  • digitalinputandoutput6211.vi – This VI simultaneously reads from a switch connected to one of the digital lines and writes digital outputs to an LED.
  • pidwith6211.vi – This VI uses closed loop control to maintain the position of a light deflector. The position of the deflector is read by a Hall-effect sensor connected to one of the analog inputs and the speed of the fan is controlled by the voltage result of a PID algorithm connected to one of the analog output voltage channels.

These examples were programmed and saved using LabVIEW Professional 8.6 and NI-DAQmx 8.7.2

 

Various LabVIEW development configurations may be needed to run these examples. Please contact National Instruments if you have questions regarding requirements to run these examples.

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