LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to search and replace a subvi in multiple VIs

Solved!
Go to solution

I have 50+ VIs that have the same subvi that needs to be replaced with a different VI.

 

Any ideas on how to do this?

Glenn Ellis
0 Kudos
Message 1 of 9
(5,269 Views)

Hi,

on the sub-vi : right click => Find All instances

Then you can check all places where the sub-vi is called, and click under "Replace with", and select the replacement VI.

Then Replace all.

 

I Hope this will solve your problem.

regards,

V-F
Message 2 of 9
(5,255 Views)

Post deleted.. ramses solution will be better:)

0 Kudos
Message 3 of 9
(5,254 Views)

Your solution only handles open VIs.

 

I need to look through 50+ VIs that are not in memory.

Glenn Ellis
0 Kudos
Message 4 of 9
(5,231 Views)

Hey glennjammin,

 

It might be sort of a pain, but you could drop all your VIs into a project and use the methods in this article. That should allow you to identify all of the VIs that use your subVI and replace them. Hope that helps!

John B.
Embedded Networks R&D
National Instruments
Certified LabVIEW Developer
Message 5 of 9
(5,222 Views)

Assuming none of the VIs are in memory, and you don't have any other projects that use the old VI, you can simply make a backup copy of the old VI and then copy the new one to the same location with the same name (assuming the same connector pane).  At least, this is what I have done with LV7.1 - no idea if this is a problem with later versions or for projects using source code control.

 

Regards,

 

Michael Tracy

Synergy Microwave

 

0 Kudos
Message 6 of 9
(5,214 Views)
Solution
Accepted by topic author glennjammin

Use a Tree VI.  A Tree VI is an non-functional VI which contains all the VIs which are part of the overall program.  Nothing is wired to any of them.  It is primarily for documentation purposes.  It is not as common with Projects.

 

If all the VIs which contain the subVI are placed on the block diagram of the Tree VI and you replace the subVI on the Tree, it should replace it everywhere.  I have not done this for a while, so make sure you look at the replacement options to be sure to replace all.

 

Lynn

Message 7 of 9
(5,207 Views)

Inject the new VI inside the old VI, the overhead of the extra call is (almost) nothing.

 

However search and replace would be my friend.

 

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!
Message 8 of 9
(5,198 Views)

Thanks for all the suggestions!  I believe the the Tree method works the best.  Also I am not familiar with it too much but it may be possible to use VI scripting.

Glenn Ellis
0 Kudos
Message 9 of 9
(5,164 Views)