Example Code

Log Data on Button Press, New File Upon Iteration

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

Download All

Overview
This VI allows the following functionality:

  1. Run the VI and start acquiring data.
  2. Push a button, upon user request, to start logging data.
  3. Push button again to stop the logging of data
  4. Repeat if necessary (If repeated, this action creates a new file for each iteration of)


Description
This VI allows the following functionality:

  1. Run the VI and start acquiring data.
  2. Push a button, upon user request, to start logging data.
  3. Push button again to stop the logging of data
  4. Repeat if necessary (If repeated, this action creates a new file for each iteration of)


Requirements

Software:

  1. LabVIEW 2014

 

Steps to Implement or Execute Code

  1. Configure "Write to Measurement File" Express VI so that user can select Filename and Path, as well as configuring the "Multiple File" set-up scheme.
  2. Run VI
  3. Push "Enable Logging" Button to toggle logging to a file
  4. Repeat Step 3 if necessary (each iteration creates a new file)
  5. Stop VI

 

Additional Information or References
NI Snippet

1.png 

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

Rob W.

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