Jump to content

Find subVI usage in a directory


Recommended Posts

I wanted to find where I had used a certain subVI, but when I tried to search for it the only method I could find was to use Edit->Find which allows me to search for the VI within all the VIs in memory. Is there some way to do such a search for an entire directory (recursively, of course) ?

The only thing I can think of would be to write a scripting procedure that would open each file, look in it, and close it. But I imagine this would be much slower than any built-in method. But if there is no built-in method...

Link to comment

QUOTE(tcplomp @ May 9 2007, 09:22 PM)

I don't totally get what you mean

Sorry for the confusion. I have a lot of LabVIEW code across multiple projects and various tinkerings, and I know that somewhere in that spaghetti of code are a few instances where I utilize a certain subVI that I made. I want to find those instances.

I think the Linker Info is a good possible method (should be faster than opening the VIs up). Thanks for the heads up. :) So does this mean that there is nothing built into LabVIEW?

Link to comment

Do you have the VI Analyzer? If so, I've written a test in the past that will do this subVI search. It doesn't ship with the VI Analyzer though...let me know and I can dig it up and post it.

-D

P.S. - If you're not sure whether or not you have the VI Analyzer, it's included in the Dev Suite, or sold separately as an add-on toolkit.

Link to comment

QUOTE(dsaunders @ May 10 2007, 07:43 AM)

So does this mean that there is nothing built into LabVIEW?

Oh, you don't mean the option to search a VI in a VI and its subVI's ? That's just in the standard search function, but you need to press Ctrl-F in the root VI of your search tree.

Joris

Link to comment

QUOTE(Darren @ May 9 2007, 11:26 PM)

I do have VI Analyzer, so I would very much appreciate you posting that. Thanks! I need to go to a class just to teach me how to use all the stuff that I own. Thar's Gold in Them Thar Hills.

QUOTE(robijn @ May 10 2007, 04:07 AM)

Oh, you don't mean the option to search a VI in a VI and its subVI's ? That's just in the standard search function, but you need to press Ctrl-F in the root VI of your search tree.

No, because this only searches within VIs in memory. It would be a pain to open all of my top-level VIs in a directory and its sub-directories.

Link to comment

Alrighty, here it is. Create a directory under your My Documents\LabVIEW Data folder called "VI Analyzer Tests". Put the attached LLB in that folder. Now, the next time you launch the VI Analyzer, you'll have a new category in your tests list called "User-Defined Tests" that contains the Find VI Calls test. With this test, you can specify the names of VIs (as strings), and the test will find any instances in your VIs of subVI calls to this VI name, along with any string or path controls/constants that contain the VI name (in case you're calling it dynamically). If you're not looking for instances of Globals, you can ignore the "Types of Globals to Detect" option on the config page (I added this for somebody who needed to only find a certain type of a certain global).

This VI Analyzer test is saved in LabVIEW 8.2.1 and is only compatible with VI Analyzer 1.1 and later (the current version as of today is 1.1). I hope it helps, let me know if you have any problems using it.

-D

Link to comment
  • 5 months later...

QUOTE(Darren @ May 10 2007, 04:37 PM)

Alrighty, here it is. Create a directory under your My Documents\LabVIEW Data folder called "VI Analyzer Tests". Put the attached LLB in that folder. Now, the next time you launch the VI Analyzer, you'll have a new category in your tests list called "User-Defined Tests" that contains the Find VI Calls test. With this test, you can specify the names of VIs (as strings), and the test will find any instances in your VIs of subVI calls to this VI name, along with any string or path controls/constants that contain the VI name (in case you're calling it dynamically). If you're not looking for instances of Globals, you can ignore the "Types of Globals to Detect" option on the config page (I added this for somebody who needed to only find a certain type of a certain global).

This VI Analyzer test is saved in LabVIEW 8.2.1 and is only compatible with VI Analyzer 1.1 and later (the current version as of today is 1.1). I hope it helps, let me know if you have any problems using it.

-D

Hi Darren,

Having just moved upto LabVIEW 8.2.1 and also got access to the VI Analyser I was interested in playing this this extra 'Test' but I am afraid I cannot get it working as you described.

I have tried placing the downloaded file in both the My Documents\LabVIEW Data\VI Analyzer Tests location and also in

C:\Program Files\National Instruments\LabVIEW 8.2\project\VI Analyzer\_tests\User Defined\Find VI Calls

on each occassion I exited LabVIEW completely and restarted, but I do not see the extra test category.

Could you please offer me some pointers in fixing this

cheers

Danny

Link to comment

Hi Danny,

I'm not sure what the problem could be...I just tried following my own procedure in the previous post and it worked fine. Double-check that the folder you created under LabVIEW Data is called "VI Analyzer Tests" (must be spelled correctly and use spaces as shown). Also, I noticed that when I tried to save the LLB from the LAVA site, it tried to stick underscores on the LLB name (Find_VI_Calls.llb). Those underscores cannot be there...the filename should be "Find VI Calls.llb" with spaces instead of underscores. Also, you may have a problem if you try to put multiple copies of the same test in different test folders, so I would remove the one you put in the project folder...that folder should only contain the shipping tests.

I can't think of anything else that could be a problem. I tried it out in LabVIEW 8.2.1 and had no problems running the test.

Keep me posted,

-D

Link to comment

QUOTE(Darren @ Oct 16 2007, 04:31 PM)

Hi Danny,

I'm not sure what the problem could be...I just tried following my own procedure in the previous post and it worked fine. Double-check that the folder you created under LabVIEW Data is called "VI Analyzer Tests" (must be spelled correctly and use spaces as shown). Also, I noticed that when I tried to save the LLB from the LAVA site, it tried to stick underscores on the LLB name (Find_VI_Calls.llb). Those underscores cannot be there...the filename should be "Find VI Calls.llb" with spaces instead of underscores. Also, you may have a problem if you try to put multiple copies of the same test in different test folders, so I would remove the one you put in the project folder...that folder should only contain the shipping tests.

I can't think of anything else that could be a problem. I tried it out in LabVIEW 8.2.1 and had no problems running the test.

Keep me posted,

-D

Darren,

Thanks for your reply I now have it loading OK, my problem was the underscores on the LLB name, I removed then and it is fine. Now I need to play with it :D

Just a note in case anyone else is interested; if you have several versions of LabVIEW you can put the "Find VI Calls.llb" under the location

C:\Program Files\National Instruments\LabVIEW 8.2\project\VI Analyzer\_tests

In fact I have created a structure under _tests "User Defined Tests\Find VI Calls" in the Find VI Calls dir I have placed the "Find VI Calls.llb2" file and a "Find VI Calls.txt" file which contains your instructions above on how to use it.

cheers for the help and the tool

Danny

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.