To download NI software, including the products shown below, visit ni.com/downloads.
Overview
To take data from an acquisition device and only calculate an average of the data when the "Log Data" button is manually turned on.
Description:
In some instances, a user may want to take the average of several data points in LabVIEW. However, the user may only want to average data once a signal voltage has settled or a certain event happens. This example allows a user to take data from an acquisition device and only calculate an average of the data when the "Log Data" button is manually turned on. When this button is turned off, the average of all the data points during the time in which it was turned on is calculated and displayed. In the example code, the Simulate Signal Express VI is used and can be replaced with either the DAQ Assistant or DAQmx VIs to be used with an actual data acquisition device. After numerous data runs are collected and averaged, the user may want to send these averages to a file or use them elsewhere in the program. By clicking the "Display All Logged Means" button once logging is turned off, all of the calculated data can be transferred elsewhere in the program. In the example, this array of averages is sent outside the main While Loop and simply displayed on the front panel.
Steps to implement or execute code
To implement this example:
To execute this example:
Requirements
Software
LabVIEW 2012 or compatible
Hardware
-
**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.