LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to load Subvi with same name in different directories at runtime?

Hi,
I have a directory DIR1 which has around 10 vi's.One of my vi calls all other vi's during runtime,i.e they are called as subvi.
If i take a copy of this directory and create another directory DIR2 under DIR1,the vi's loaded during runtime still are called from
DIR1 rather than DIR2.How should this problem be solved?
Also,can't i specify a vi's path from where it needs to be loaded (suppose my drive had many vis' with same name)?
Any advice please ?
0 Kudos
Message 1 of 4
(2,814 Views)
Hi,
There is something called reentrant in Labview options,so for VI's which you need to use moer then once in the same program you can make use of the same.Else make a copy of the same vi and rename it for reuse in the same program for more then one use.
hope it helps
vicky
Message 2 of 4
(2,810 Views)
nalin,

When it is saved, a VI makes note of the paths where its subVIs can be found. When it is closed and reopened, the VI looks for its subVIs in those saved locations, and it only begins searching other locations if it cannot find a subVI at the expected path.

So, in your scenario, the main VI can still find all its subVIs in the expected DIR1, and it has no reason to go looking in DIR2 or anywhere else.

If your objective is to replace all the subVIs with modified versions, then what you need to do is archive the old versions (copy them elsewhere) and then overwrite the originals (DIR1) with the new versions (the DIR2 versions). Now, the main VI will automatically load the newer subVIs when it is opened.

Up through the current version of LabVIEW, VI names have been extraordinarily important, because they are the only cue that LabVIEW uses to determine which is the correct subVI to load. This has caused some headaches, both for users and even for NI developers, as demonstrated in another active thread here about a conflict between a daqMX VI and a Report Generation VI with the same name. NI will probably address this problem in a future LabVIEW release. In the meantime, you should avoid creating multiple independent VIs with the same name on your filesystem, unless they are archived versions that you don't plan to work with again.

Regards,
John
Message 3 of 4
(2,796 Views)
Thanks a lot John.
I learnt that each vi stores the path of it's subvi to be loaded.
Hope NI will address this problem and gives the user an option to select the path
where a subvi resides.
Thanks once again john to take your time off and explain.
Regds,
Nalin
0 Kudos
Message 4 of 4
(2,770 Views)