11-23-2009 03:07 PM
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.
Solved! Go to Solution.
11-23-2009 03:36 PM
11-24-2009 10:18 AM
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)))))
11-24-2009 02:43 PM
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.
11-25-2009 11:36 AM
Hi Waldemar,
glad to hear it and thanks for the Kudos.
Have fun with LabVIEW.
With best regards
Ralf N.
Applications Engineering
NI Germany