Darren's Weekly Nugget 08/21/2006

Darren's Weekly Nugget 08/21/2006

Post by Darre » Wed, 23 Aug 2006 01:40:09


Here's another feature I added to LabVIEW 8.20.  Check out the six new VIs in the File I/O > Advanced File Functions subpalette.  Some of them were already shipping with LabVIEW, but I added them to the palettes in 8.20 in hopes that people will find them and use them.  Here's what they do:

- Check if File or Folder Exists.vi - Given a path to a file or folder, returns a true/false value as to whether or not that file/folder exists on disk.

- Recursive File List.vi - Given a path to a folder or LLB, will return all the contents of that folder/LLB...in the case of folders, it will recurse all subfolders to return their contents as well.

- Compare Two Paths.vi - Given two paths, will return a true/false value as to whether path B is relative to path A, and will also give the relative path between the two.

- Get File Extension.vi - Given a path, will return the file extension of that path, along with the part of the file name that preceeds the extension.

- MD5Checksum File.vi - Returns the MD5 checksum of a file.  I've talked about this VI in a previous nugget, but it's officially on the palettes now in LabVIEW 8.20.

- Generate Temporary File Path.vi - Generates a unique path that you can then use with other File I/O VIs and functions to create a file in the temporary folder on your system.

I hope LabVIEW developers find these useful.  Make sure to <a href=" http://www.yqcomputer.com/ " target="_blank">submit suggestions</a> to LabVIEW R&D if you find yourself writing VIs to do common functions that you think should be on the palettes for all to use.  That was my primary motivation for putting these VIs on the palettes in the first place.
-D
P.S. - Check out past nuggets <a href=" http://www.yqcomputer.com/ ;message.id=1669" target="_blank">here</a>.
 
 
 

Darren's Weekly Nugget 08/21/2006

Post by unclebum » Wed, 23 Aug 2006 04:10:07

Tell me about it. I'm still stuck in a 7.0 world and hoping NI makes a new policy for free software after 1000 posts!!:smileysurprised:
Darren,
Did you use a queue in your recursive File vi to hold the items??Message Edited by unclebump on 08-21-2006 01:41 PM

 
 
 

Darren's Weekly Nugget 08/21/2006

Post by unclebum » Wed, 23 Aug 2006 05:40:10

I thought the queues were pretty fast based on this thread.
<a href=" http://www.yqcomputer.com/ ;message.id=116854&requireLogin=False" target="_blank"> http://www.yqcomputer.com/ ;message.id=116854&requireLogin=False</a>
Here is a file list that I made with queues in this thread.
<a href=" http://www.yqcomputer.com/ ;message.id=191444&requireLogin=False" target="_blank"> http://www.yqcomputer.com/ ;message.id=191444&requireLogin=False</a>
 
 
 

Darren's Weekly Nugget 08/21/2006

Post by Darre » Wed, 23 Aug 2006 05:40:15

Damien's single-element queues are not really being used as queues, but as a data store.  The benchmarking he did was comparing the single element queues against other data storage/retrieval mechanisms.  That's a different use case than recursion, where you would be using the queues to actually store multiple items (the files/folders you're recursing).  If you want to benchmark my VI vs. yours in terms of performance on recursing folders, go for it...like I said, it was a while ago, but when I did it, the shift register/build array method was faster.  As I mentioned in my previous reply, my VI ships with LabVIEW 7.0, so you can try it.  Note that you have to run File I/O benchmark VIs more than once, since the first run will often take an indeterminately longer amount of time, as Windows implements caching to speed up subsequent File I/O operations.
-D
 
 
 

Darren's Weekly Nugget 08/21/2006

Post by PaulG » Wed, 23 Aug 2006 21:40:10


You bet it is! We recently upgraded from 7.1. Got 8.0 installed then went ahead and installed 8.2 less than a week later. Between the 2 ugrades there are over 170 pages of upgrade notes. :smileysurprised: