LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dependancy Path

I hope I am clear with this explanation.  I thought it would be easier to generalize file and path names to illustrate an example for my question. 

 

Let's say I have two main vis that are different (i.e. they do different things).  Each subvi in both main vis are also different.  However, let's say one subvi in the first main vi has the same name as another subvi in the second main vi.  Moreover, the subvis with the same name are located in different directories.


C:\Path1\MainVI1.vi contains C:\Path1\Mysubvi1.vi
C:\Path1\MainVI2.vi contains C:\Path2\Mysubvi1.vi 


If I open and then close C:\Path1\Mysubvi1.vi, and the open C:\Path2\Mysubvi1.vi, I will receive warnings stating that the expected file path has changed.  It will revert to the file path of C:\Path1\Mysubvi1.vi. 

 

e.g.

(from C:\Path1\MainVI1.vi) 

OPEN  C:\Path1\Mysubvi1.vi
CLOSE C:\Path1\Mysubvi1.vi

 

(from C:\Path1\MainVI2.vi)
OPEN  C:\Path2\Mysubvi1.vi

 

*warnings*
expected file path C:\Path2\Mysubvi1.vi
new file path C:\Path1\Mysubvi1.vi

 

Is there a way to not change the dependancy path?  That is, once a vi is built/compiled, is there a way to "set" the file dependancy to not change? 

 

Let me know if I need to clarify.  Thanks!

 

0 Kudos
Message 1 of 5
(2,341 Views)

You cannot two VIs with the same name in memory simultaneously. That's why you are seeing what you are seeing. What you can do is to place your main VI and subVI into separate project files. Then the project files will act as namespaces. You can then have both projects open and all 4 subVIs open at the same time (assuming you open the projects first).

 

Please read the LabVIEW documentation on projects.

0 Kudos
Message 2 of 5
(2,331 Views)
1. put all your vi in a project. 2. for vi with same names located at different location, you should think about putting them in separate lvlib. The lvlib's name will append to the vi name inside labview, so labview will see them as vis with different names.
------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 5
(2,327 Views)

I anticipate your solution will work.  But, in my example, I close the 1st subvi before opening the 2nd subvi (1st subvi name = 2nd subvi name).  This is where the problem comes in.  When opening the second subvi, it wants to use the file paths from the first subvi, even though the first subvi is closed.  It appears Labview does this because the subvi's names are the same.  I find that strange.   

 

I'll try adding the vi's to projects and see what happens.     

0 Kudos
Message 4 of 5
(2,306 Views)

If you have the main VI open closing the first subVI will have no effect - it will close the front panel, but the VI is still in memory.

 

As for using project files vs project libraries, this is somewhat of a "purpose" issue. While, technically, either will accomplish the same thing, in general project libraries are better suited to create libraries of a group of VIs that share a common link, like a "Tools" library, or an "Error Handling" library. At the top-level you really should be using projects, not project libraries.

0 Kudos
Message 5 of 5
(2,301 Views)