LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically find the path to the project file

Solved!
Go to solution

I'm trying to find a way to get the path to the project file in the development environment.

I have attached a small project in LV 8.5.1 with a project file, a library file and the VI. I can get the path to the library file but not to the project. This path is always <Not a Path>.

I know the problem exists in LV 8.6.1f1 but I didn't made a test in LV 2009.

I'm aware that in real world there could be more nested levels of  library files but that doesn't matter when this simple example doesn't work.

If this is related to the problem I first created the library using File >> New... and later I created the project and added the library.

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
0 Kudos
Message 1 of 5
(3,048 Views)
The forgotten project. It seem I'm getting old and forgetable.
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
0 Kudos
Message 2 of 5
(3,042 Views)
Solution
Accepted by topic author waldemar.hersacher

Hi Waldemar,

 

here comes a small piece of code and a related link. 

 

 

http://forums.ni.com/ni/board/message?board.id=170&message.id=220269&requireLogin=False 

 

 

Hope this helps.

 

 

With best regards

 

Ralf N. 

Applications Engineering

NI Germany

 

 

PS: Don't forget the Kudos. :o)))))

Message 3 of 5
(3,012 Views)

Hi Ralf,

 

I thought, that LV maintiains something like <project>:<library>:<VI>. I can see  <library>:<VI> in the titlebar of the VI. And this seems really to be the end going from bottom to top. When you have the reference of the library you will never get the project, neither with the property parent nor project.

 

 Your solution has the following advantages, besides the one it is working:

- You get the correct project file path even when two projects are loaded using the same library  and VI.

- You do not need to loop through a nested level of libraries. It works also in the case of nested libraries without modification.

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
0 Kudos
Message 4 of 5
(2,997 Views)

Hi Waldemar,

 


glad to hear it and thanks for the Kudos. 

 

Have fun with LabVIEW. 

 

 

With best regards

 

Ralf N. 

Applications Engineering

NI Germany

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