From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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

Write One Second and One Minute Average to File using LabVIEW

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

Code and Documents

Attachment

 Overview
This example VI shows how to log one value every second and 60 values average every minute.

 
Description
This VI iterates one loop for second.  A random value is generated every loop iteration and put into the array.  The random value is also written to a spreadsheet file.  The loop executes the true case once every minute.  Inside this case the array of values gets averaged and that average value is written to a spreadsheet file.

 
Requirements

  • LabVIEW 2012 (or compatible)

 
Steps to Implement or Execute Code

  1. Open the VI
  2. Select the path o create new log files
  3. Run the program

 

Additional Information or References
VI Block Diagram

 Array averaging and logging LV2012 NI verified.png 

 

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

Justin Parker
National Instruments
Product Support Engineer

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