LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't open a VI from an lvproj file using its project path.

Solved!
Go to solution

@JonP wrote:

Your earlier solution with the GetFindResults function looks neater but I don't like to use "brown" functions as they are unreleased, right? I don't even remember how to make them show, perhaps you could remind me?


Use the super secret private key.

 

The brown nodes are undocumented and not guaranteed to be available in future versions.

 

I'm sure NI uses the function a lot, doing project related scripting without that function is tedious.

 

The project scripting API could be better for sure.

0 Kudos
Message 11 of 15
(1,239 Views)

wiebe@CARYA wrote:

The brown nodes are undocumented and not guaranteed to be available in future versions.

They are not guaranteed to work in any particular version, even if present. Quite a few are just a place holder put in by a LabVIEW developer in anticipation of some use or as testing ground for a potential new feature and might never have been (fully) implemented. Their interface can change between LabVIEW versions, causing bad crashes if you don't enforce recompilation, which the node may not enforce itself as it doesn't always implement the full LabVIEW node interface. And as alluded by Wiebe, they can disappear without any notice, friendly warning or whatsoever from one version to the next.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 12 of 15
(1,236 Views)

Fear not, Rolf, I am not going to use that function, I have accepted Wiebe's second solution (the one that searches for the item with a nested loop) as although it is similar to mine it is simpler because I hadn't noticed the "Root" property and was using "Targets" instead, which required a separate search for the root item.

 

I also didn't notice that you could get a VI reference directly from the leaf ProjectItem, which Wiebe's first solution shows. That saves me doing an "Open VI Reference" on the VI path. So thanks, Wiebe!

0 Kudos
Message 13 of 15
(1,227 Views)

wiebe@CARYA wrote:

@paul_cardinale wrote:

wiebe@CARYA wrote:

Opening a project does load some VIs. For instance, classes are loaded, and all their VIs.

 

Open VI Reference accepts a path specifying the location on file, or a string specifying the name of the VI. It doesn't accept the path in the project as a string.

 

Open the project, find the VI in the project either get it's path and use it to open the VI, or get the VI refence directly from the project:

VI From Project.png


Nice.  Can you tell us what all the bit meanings are for the Flags input?


No, because I have no idea.

 

I experimented (a tiny bit) and found 2 will return exact matches.

 

I wandered about the flags myself, but unless NI let us know, I don't think there's a (legal) way to find out.

 

Perhaps just empirically trying out all flags on a DUT project gains some insight, but it will be a lot of work, and no guarantees.


I found them: 1 = Case Sensitive.  2 = Match Whole Word.  4 = Regular Expression.

If anyone's afraid of using that brown method, instead you can use ...\National Instruments\LabVIEW 20xx\resource\Framework\Providers\ProjectFindDlg\subWrapGetFindResults.vi  which is just a wrapper for it.  If they decide to mess with "GetFindResults", there's a good chance they'll update subWrapGetFindResults.vi so old code won't break.

 

"If you weren't supposed to push it, it wouldn't be a button."
Message 14 of 15
(1,203 Views)

@paul_cardinale wrote:

I found them: 1 = Case Sensitive.  2 = Match Whole Word.  4 = Regular Expression.

Interesting. Good to know.

0 Kudos
Message 15 of 15
(1,200 Views)