From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Finite Sampling Progress Bar & Automatic Scale Adjustment

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 you to view the "real-time" progress when acquiring a finite number of samples by the means of a graphical progress bar. 

Description

 Based on the data entered by the user, the VI will automatically scale the chart x (time) axis to fit exactly with the number of samples acquired. The progress bar scale values are also updated in a similar fashion.

 

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. Download both attached VI's. Configure Timing & Scales is a sub VI within the Sampling Progress VI.

  2.  Specify your Channel to sample.

  3.  Specify the sampling rate and number of samples (refresh rate should generally be left, updating beyond 50Hz will not be noticed by the user and is likely to cause problems).

  4.  Run the VI.

  5.  Experiment with altering the number of samples and rate of acquisition.

 

Additional Information or References

 

SamplingProgressVI.png

SamplingProgressFP.jpg

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

 

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