From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there anyway to "auto-populate" a project library, that is an lvlib?

What I want to do is add a set of files to a project library that already exists.

 

Here is the scenario:


1.  Create a directory structure.   Auto-populate is turned on.  Add or create VIs, ctls, ...   

2.  Turn off Auto-Populate.
3.  Convert to library.
4.  Later on (days or months even).

5.  Create new VIs and save them into folders that are part of the library.
6.  Somehow tell the library to auotmatically add all these new files to the lilbrary.

 

Do you  know an easy way to do this?

 

(A corrilary question would be how to automatially disconnect all files and folders from a library.  In that way I could just re-create the library anew from the directory structure.  I would have to set access modes though.)

Mark | CLA
0 Kudos
Message 1 of 7
(4,114 Views)

@Mark_L wrote:
[...]

5.  Create new VIs and save them into folders that are part of the library.[...]


You do this outside of the lvproj you use to manage your lvlib?

If so, you should re-enable auto-population:

autopopulate.png

 

Once all items in the lvlib are update, you can turn it off again.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 7
(4,103 Views)

I am working within the Project or within the Library, both within LabVIEW.  

The newly create VIs would be saved to a folder where the other library files are also located.  

 

The "Convert to Auto-populating Folder..." right click option is not available inside the library.  

 

Untitled.png

Mark | CLA
0 Kudos
Message 3 of 7
(4,087 Views)

Usually I delete the virtual folder that was created and just drag the folder from Windows Explorer back to where it should go.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(4,061 Views)

@Mark_L wrote:
[...]

The "Convert to Auto-populating Folder..." right click option is not available inside the library.  

 [...]


That is correct and mandatory.

Is it correct if i state: You create the VIs OUTSIDE the library (lvlib) and then want to ADD those VIs easily to the library (lvlib).

 

If i am correct, the issue you are facing is that both the lvlib file (XML file) AND the VI file (binary) know of each other: name and location.

This is necessary as the lvlib file defines things like access scope for each library item. Hence the VI requires the knowledge where the lvlib is located.

 

You cannot add a VI to a lvlib outside of LV as that process requires to modify both the XML based lvlib file as well as the binary VI file. Therefore you have to use the Add function of the lvlib context menu in your project window and select all (multiple) files.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 5 of 7
(4,040 Views)

OK.  I understand now how to make a new VI easily part of the library.   Thanks.

 

If I right click on the library in the project and select New >> VI then the VI will be in the library.  Even though it is say in the Private VIs folder on disk I have to move it there in the library from within LabVIEW.  

 

If I have the library highlighted and select from the menu File >> New VI the VI will be in the project and I will have to add it to the library by moving the VI from within LabVIEW.  

 

This is what I was doing and seemed overly complicated.   I would get several VIs that were not listed in the library this way.

 

By using the right click method the VI is at least in the library although I have to move it to the correct virtual folder.  

 

 

Thanks again this helps.   

 

Mark | CLA
0 Kudos
Message 6 of 7
(4,012 Views)

You can also just drag the icon from either the block diagram or front panel where you want it to go in the library.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(3,995 Views)