LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can you find and replace all sub-VI's in memory at once?

I have a vi that is being called by other vi's as a sub-vi. I need to replace all occurences. I can find all occurences with an LabView edit tool but it is veru cumbersome to click on each occurence and replace manually. I am wondering if there is an easier way to replace all occurences at once. If there is no such function built-into LabView, is there anyone who attempted to do this task programatically? Or, some other tricks that I haven't found?
0 Kudos
Message 1 of 5
(3,309 Views)
Close LV. Rename your old VI and name the new VI the same as the old one and have it in the same location. Start LV and load your VIs. The VIs will now find the new VI.
If you want the new VI to have a different name from the old one open the VI and keep all the other loaded. Save the new VI with File >> Save As... under the new name. Be sure that the checkbox at the bottom of the dialog is not set. This way you will get the VI with the new name and all loaded VIs will reference to the new name. Then you can delete the new VI with the old name and rename the old VI to its original name.

Waldemar
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 5
(3,309 Views)
I've done this way successfully. But, I had to relink all replaced VIs. This way saves me time not having to replace the files but I still have to go though all occurences and manually relink them. Relink is rquired even when the panel connectors are slightly rearanged. Did you have similar experience?
0 Kudos
Message 3 of 5
(3,309 Views)
Yup this works only if you have exactly the same connectors on your new VI. In all other cases you have to relink the Vis.
0 Kudos
Message 4 of 5
(3,309 Views)
The only other sub-vi replacement situation in which you would not need to re-link sub-vi's is if the connector pane has not changed and the only change to the connections on the connector pane is that the only additional controls/indicators have been added to some empty terminals. In this case, you just need to save the change to the caller.

So there is a small possible future time savings advantage of choosing connector panes with extra unconnected terminals when you first write a VI which will likely change and will be called from many callers. But if you change a control type or the connector pattern, or remove an item association from any terminal of the connector pane, relinking will be necessary.

If the problem justifies the effort, you c
ould always write one or more sub-vi call wrappers that use VI server methods to set and get the sub-vi's control/indicator values by name. If your sub-vi has certain inputs that only take effect in some types of calls, this could allow you to have different simplified wrapper sub-vi interfaces to the same core sub-vi.
0 Kudos
Message 5 of 5
(3,308 Views)