From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Search and Create Directory?

Hello,

how do I search for a directory and create it if it doesn't exist?
Unfortunately, the 'New Directory' vi can't create a new directory
with sub directories. For example, I want to create the directory
'c:\measurements\data'. The 'New Directory' vi is only successfull if
c:\measurements already exists. But this is not necessarily the case.
In general, it is not fixed how nested the new directory is and how
many sub directories already exist.

What I would like to have is a dialog that pops up if the specified
directory (control) doesn't exist. It informs the user that it doesn't
exist and asks him or her to create it. The user can click a Yes or a
Cancel button. Then it creates the directory as appropriate. Actually
this is just a st
andard Windows dialog.

I use LabView 5.1

Any help would be great


Johannes
0 Kudos
Message 1 of 7
(3,326 Views)
Here's a picture of a vi someone gave me. It works pretty nicely. Automatically creates a file path if the path does not exist. This is my first post with picture attachment so if I did it wrong someone please let me know.
Message 2 of 7
(3,323 Views)
asimpleman,
The picture is visible, but if you save it as a .jpg or .png (with Paint or other program), the file is much smaller and takes less time to pull up.
 
Michael
0 Kudos
Message 3 of 7
(3,054 Views)

If you have the Professional edition of LabVIEW 5.1, you can use the following VI:

[LabVIEW 5.1]\project\Source Code Control\_utils\Create Directory Recursive.vi

This VI is available in all editions of LabVIEW starting in version 7.0 in vi.lib\utility\libraryn.llb.

Good luck,
-D

P.S. - Here is a screenshot of the VI from LabVIEW 5.1, so you can compare it to the example posted previously.

Message Edited by Darren on 04-16-2007 01:35 PM

Message 4 of 7
(3,049 Views)

Sorry Darren, I shouldn't have replied to this post, the original was in 2003! I was doing a seach on the subject of creating directories and I mixed it up with the current threads.

I had seen a previous post where you mentioned this Create Recursive Directory.vi, I had no idea it existed. It works very well. I was wondering if you've found any other useful VI's in vi.lib\Utility

Michael

0 Kudos
Message 5 of 7
(3,042 Views)
There are lots of useful VIs in vi.lib\utility, and many of them are on the palettes.  You can check out some of my weekly nuggets from last year where I talk about other cool VIs that ship with LabVIEW.  Also, there are many VIs in vi.lib\utility\libraryn.llb that help with File I/O...in fact, I put several of them on the palettes in LabVIEW 8.2.
 
Enjoy,
-D
0 Kudos
Message 6 of 7
(3,040 Views)


@Darren wrote:
 I put several of them on the palettes in LabVIEW 8.2.
 
Enjoy,
-D


Even better some of the OpenG palette's are just pointers to VI.lbi\utility VI's (librarian and rectangle for instance).

If you install the packages you'll find a lot of basic programming Q's are already solved.

Ton


Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 7 of 7
(3,015 Views)