Virus scan in progress. Please wait to download attachments.
Overview This example highlights how to dynamically and programmatically create a file and open a reference to it, when both the file and the directory structure need to be created.
Description Without creating non-existent folders in the specified file path, an "Error 7" error is caused by the "Open/Create/Replace File" vi. This example shows how to prevent this error from happening.
"Create Folder vi" is used to create the missing folders, only if they don't already exist. The "Create Folder vi" causes an error if the specified file path already exists, so if it does already exist, we don't want to call the "Create Folder vi". To accomplish this the "Check if file or folder exists vi” is used to control the case structure with the "Create Folder vi" inside.
LabVIEW 2012 Base Development System (or compatible)
Steps to Implement or Execute Code
Download the VI “Dynamically Create Directory 2012 NIVerified.vi”
Run the program
Additional Information or References VI Block Diagram
**This document has been updated to meet the current required format for the NI Code Exchange.**
Product Support Engineer National Instruments
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.