05-18-2009 04:00 PM - edited 05-18-2009 04:01 PM
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!
05-19-2009 01:34 AM
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?
05-19-2009 09:46 AM
05-19-2009 09:55 AM
05-19-2009 10:13 AM
Faraclas wrote:
I am interested in this "private functionality".
Have a look at the Code Capture Tool. It shows how to do this.
05-19-2009 10:16 AM
05-19-2009 10:27 AM
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
05-19-2009 10:28 AM
"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.
05-19-2009 08:03 PM - edited 05-19-2009 08:03 PM
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.
05-20-2009 02:57 AM - edited 05-20-2009 02:59 AM
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