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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 05/18/2009

Here's a utility VI that I originally wrote for a colleague, but I figured might be useful for a wider audience.  If you place this VI in your [LabVIEW]\project folder, you'll now have a Tools > Explore... menu option on VIs.  When you select this option on the menu of a VI, it will open the folder containing that VI in Windows Explorer.  If the VI resides in an LLB, the LLB Manager will open with that LLB as the current location.  It does nothing if you launch it from an Untitled VI, a Project Window, etc.

 

Explore works in LabVIEW 8.5 and later.  I had to password-protect it because of some private functionality used to get info on the VI from which the menu action was taken, but at its core, it simply uses System Exec VI to run explorer.exe with a few arguments to open to a specific folder:

 

 

 

I hope you find this VI useful!

Message Edited by Darren on 05-18-2009 04:01 PM
Download All
Message 1 of 11
(6,368 Views)

Note that if you're using a project you can also do this by clicking File>>Locate in Project... and then right clicking the item in the project tree and selecting Explore.

 

... 

 

What do you mean "I don't have that option in the File menu"? Don't you use OpenG?


___________________
Try to take over the world!
0 Kudos
Message 2 of 11
(6,293 Views)
I am interested in this "private functionality".  Inside tricks like these are exactly what the community needs to develop sophisticated tricks and applications, like the one in this topic, on their own.
0 Kudos
Message 3 of 11
(6,192 Views)

Faraclas wrote:
I am interested in this "private functionality".

See here and here (announcement)

0 Kudos
Message 4 of 11
(6,183 Views)

Faraclas wrote:
I am interested in this "private functionality".

Have a look at the Code Capture Tool. It shows how to do this.


___________________
Try to take over the world!
0 Kudos
Message 5 of 11
(6,170 Views)
All of these links provided are very interesting.  However, the intent of my original comment is for the author to fully share the details of his posts, both current and future.
0 Kudos
Message 6 of 11
(6,168 Views)

The origignal poster (Darren) will not reveal the password or the contents of the VI because some of the used functions are not available to the general public and are considered only to be used carefully by NI R&D.

However the used functions are not spectacular and can be found within the Code Capture Tool Tst mentioned.

 

The function return the name of the VI calling the menu tool. If the name starts with 'Project Window' the function was called from a project window. You can get the active project from any application.

 

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 11
(6,153 Views)

"Private" functionality does not mean "advanced" or anything like that. It means functionality which NI has not made accessible (for whatever reason). As such, there is a limit to what Darren can do, since he works for NI. Even when scripting is released, LabVIEW will continue to have private functionality, so we might keep seeing things like this.


___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(6,148 Views)

tst is right...as an employee of NI, I can't post VIs that use private/scripting functionality without password-protecting them.  Even when scripting releases, I'll still be password-protecting any VIs I post that contain private functionality.

 

All that being said, I have received some requests for more information on how Explore.vi works.  It's very simple.  I've attached a screenshot here:

 

 

Off to the left (not shown) is the private functionality that returns the Owning Application and the Name of the VI from which Tools > Explore was launched.  If the Name string is empty, the outer case structure does nothing.  If there is a valid VI Name, I get the VI Path and make sure it's not invalid (like an Untitled VI that hasn't been saved to disk yet).  Assuming the path is valid, I use System Exec VI to pass the stripped path (which is the folder/LLB that contains the VI) to a command line call to explorer.exe to launch a Windows Explorer window open to the folder/LLB that contains the VI.  

 

Now that you all know how the VI works, if anybody expands on the functionality of Explore.vi, please post your VIs here so we can see what you did.

Message Edited by Darren on 05-19-2009 08:03 PM
Message 9 of 11
(6,091 Views)

Here is a version that works for projects as well.

As password protected VI (I don't know the password) and as an installable OGP package for use with VIPM.

 

Ton

Message Edited by TonP on 05-20-2009 09:59 AM
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!
Download All
0 Kudos
Message 10 of 11
(6,049 Views)