LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 08/21/2006

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 submit suggestions 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 here.

Message 1 of 9
(11,058 Views)
Man, the pressure to update is mounting!


2006 Ultimate LabVIEW G-eek.

Message 2 of 9
(11,045 Views)

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!!Smiley Surprised

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

0 Kudos
Message 3 of 9
(11,002 Views)
0 Kudos
Message 4 of 9
(10,987 Views)
Thanks for posting the screenshot, Paul.  No queues here...a shift register with Delete From Array and Build Array is quite a bit faster than using queues.  I benchmarked it back in the day...I don't remember the results, but my way was faster.
 
By the way, the Recursive File List.vi ships in LabVIEW 7.0 (check in vi.lib\utility\libraryn.llb)...it didn't have the "pattern" input back then, though.  I added that in LabVIEW 8.2.
 
-D
0 Kudos
Message 5 of 9
(10,945 Views)

I thought the queues were pretty fast based on this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=116854&requireLogin=False

Here is a file list that I made with queues in this thread.

http://forums.ni.com/ni/board/message?board.id=170&message.id=191444&requireLogin=False

0 Kudos
Message 6 of 9
(10,930 Views)

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

0 Kudos
Message 7 of 9
(10,920 Views)
Sounds like functions provided by OpenG... Anyway that's cool if they now come built-in 🙂


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 8 of 9
(10,871 Views)


@Jonnie_5 wrote:
Man, the pressure to update is mounting!



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. Smiley Surprised
PaulG.
Retired
0 Kudos
Message 9 of 9
(10,826 Views)