LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Projects and Project Libraries

Solved!
Go to solution

I've been happily using Projects since they were introduced in LabVIEW 8-something.

 

I've got a Project whose task involves examining directory trees containing other VIs.  In some cases, the VIs my code examines have the same name as one of the VIs being used in the code (I'm running in Development Mode, not from an executable).  To avoid "name clashes", I did a search on NameSpaces and learned about Project Libraries.

 

So I've successfully ported all of the files in my Project into a similarly-named Project Library.  The code works just fine.

 

Today, I opened my Project to look at one of my VIs, and to my horror, the Project had none of the files showing.  It also didn't show the Project Library (where I "knew" all the files were located).  A tad worried, I looked on my disk, and found the Project Library (.lvlib) file -- if I double-click it, there are my files!

 

What I'm having trouble doing (maybe because it is impossible!) is getting a view "inside" my Project Library from the Project Explorer.  Given the close relationship between Projects and Project Libraries (the second is created from the first, for example), I would have expected to see such a link.  Does it exist?  Or are you expected to open both a Project (which, in my case, has files that are not in the Project Library) and the corresponding Project Library?

 

Note I did a search through the NI Documentation on Project Libraries, and what I read emphasized the close relationship between a Project and an associated Project Library, including giving them the same (or similar) name and keeping the files in the same folders.  [Hmm -- I just realized I did not name my Project and Library identically -- I called the Project "Project XYZ", and the Project Library "Library XYZ" ...].

 

Experience "from the field" would be most welcome!

 

Bob Schor

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

Would you mind posting your project so someone could take a look at it?

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

@User002 wrote:

Would you mind posting your project so someone could take a look at it?


Dear Handy,

 

     Humble Pie time (again!).  When I saw your request, I said (to myself, silently) "Just how dumb do they think I am?".  So this morning, I brought back an earlier pre-Library version of my Project, captures some screen shots of "Before", and started to (re-)create my Library.  I couldn't remember exactly how I did it before, so I followed the steps in the LabVIEW 2011 Manual.  I did a "New, Library" from My Computer in the Project, and dragged stuff into it.  This time, I noticed there was a lot of "saving VIs" that I didn't recall from my earlier (first) Project Library.  When I was done, there, in Project, right where I was expecting to see it (but wasn't!) was my Project Library!

 

     So what did I "do wrong" before that caused the Library to "disappear" from the Project?  Who knows, but I clearly did something (mysterious) incorrectly -- I'll try not to do whatever-it-was again!

 

     Onward and upward (or maybe onward and downward, since Austin, home of NI Week, is south from here ...).

 

Bob Schor

0 Kudos
Message 3 of 5
(2,419 Views)
Solution
Accepted by Bob_Schor

The project library is just an xml file containing links to all of the objects that make up the project. An .lvlib is also an XML file that contains links to the objects it owns. VIs are marked as belonging to a library. They do not belong to the project. If the .lvlib is included in the project you will be able to expand it to see the items it contains. You do not need to have a project in order to create an .lvlib. You can create one from File/New in the getting started window. You can drag any .lvlib to a project just as you can a VI. You do not drag VIs that an existing .lvlib contains into the project explorer. Also remember that the .lvlib does not contain the VIs or other objects. If you open it in notepad you will see a list of the objects.

 

What probably happened is that you didn't save the .lvproj after creating and adding the .lvlib to it. All you would have had to do is find the .lvlib in Windows Explorer and drag it to your project.

=====================
LabVIEW 2012


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

Yes, indeed, dragging the Library (which was, after all, in exactly the same physical folder as the Project and all of its files) back into the Project (in Project Explorer) made it "visible" (as did my subsequent "try to recreate this and point out the bug to NI", which turned out to be the usual Stupid User Error!).

 

Thanks for (a) the clarification, (b) an explanation of how I (probably) went awry, and (c) how to "recover" from my mistake.

 

Bob Schor

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