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

Automatically Store a Selected Folder and Create New File Path Each Time Program Runs 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 shows a way to automatically create files within a folder each time a LabVIEW program is ran.

 

Description

This particular case involves a non-repetitive test, but one in which the operator will keep the VI open between tests. Therefore, feedback nodes may be applied to store a selected folder between each execution of the VI, thus allowing paths to be stored without the use of shift registers and a looping structure.

 

Requirements

  • LabVIEW 2012 (or compatible)

 Steps to Implement or Execute Code

  1. Download the VI.
  2. Open the VI.
  3. Run the VI with the Auto/Manual switch in the OFF position
  4. Choose or create a folder
  5. Run the VI repeatedly and notice a new file path is created each time the VI runs

Additional Information or References

VI Block diagram

Folder.PNG

 

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

 

Matt J - NI Tools Network

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