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: 

Virtual folder to LLB programatically

Hello all,

 

Is there any way to get the “convert folder to LLB(see attachment)” option programmatically?

 

Thank you.

-
Amit
CLAD
0 Kudos
Message 1 of 7
(3,581 Views)

The "Convert to Library" option on the menu shown in the attachment converts the virtual folder to a Project Library, .lvlib and NOT to a LabVIEW Library (LLB), .llb.

 

I do not know of a way to directly access the "Convert to Library" functionality programmatically, but it is possible to code the same functionality by getting the project item, getting all of the items owned by the project item, adding a new Project Library item, moving all of the owned items to the new Project Library, and then deleting the original item.  Note that any interaction with project items like this is done using LabVIEW VI Scripting.

 

What is your goal?  A tool using scripting to extend project / library management?



0 Kudos
Message 2 of 7
(3,561 Views)

Hi, 

Thank s for your answer, my goal is to make autompopulating under the ".lvlib" or like add the folders and files under .lvlib from some physical location.

 

so far I have the code to create this but it takes the root as 'My Computer' (see theattachment run project creation tool). I want root as .lvlib. 

 

That is the reason i wanted to convert the Virtual folder into .lvlib.

 

Thank you.

-
Amit
CLAD
0 Kudos
Message 3 of 7
(3,552 Views)

It sounds like what you want to be able to do is point at a folder and have it snapshot the folder's contents into a library.  As you pointed out, you can add the folder manually and then right-click -> Convert to Library.  You could also right-click -> New -> Library and then right-click the library -> Add -> Folder (Snapshot)...

 

But you are requiring that it be done programmatically.

 

 

I took a look at that code.

 

In Project Creation Tool.vi, between the node that gets My Computer and your Add Folder.vi, you can create a library (Application Invoke Node, Library.Create), add it to the project under My Computer (Property Node using the library reference, Name  -  then Invoke Node using the My Computer reference, AddItemFromMemory with the library name wired in), and then use the resulting project item reference (which is to the library) as the input to your Add Folder.vi.

 

This should create a library (in memory), add it to the project, and then add the folder, files, subfolders, etc. (whatever your Add Folder.vi does) to the library instead of to My Computer.

Make modifications to the process then to do exactly what you want, for instance name the library after the folder you are targeting, modify Add Folder.vi to add all of the contents of the folder but not the folder itself, save the library, etc.



Message 4 of 7
(3,531 Views)

Hi,

Thank you for you auggestion. that was helpful. But making things to be easy I created .LVLIB  physically(i am new to invoke, property node).

 

Now,(attachment will help)

 

we are getting Incomplete Population and showing error 56003.

 

"Invoke Node in Add Folder.vi:7->Add Folder.vi:6->Add Folder.vi:5->Add Folder.vi:4->Add Folder.vi:3->Add Folder.vi:2->Add Folder.vi:1->Project Creation Tool.vi"

 

 

 

after further diggning into error 56003,(http://forums.ni.com/t5/LabVIEW/error-56003-building-packed-library/td-p/3057332?device-view=desktop...

 

I found this may due to the conflict present during this automatic building.


To have, sureity of above I tried removing all possible files which may have dependancies(all VI and may be CTL) and only kept files which are impossible to have dependancies (only kept .txt, images and .doc files)and then found it is working exactly want we wanted.

 

Further I am finding about,
1. how to solve this 'conflicts' automatically ? and
2. why this is happening only when we are building under .lvlib ?

 

 

Thank you for your time.

-
Amit
CLAD
0 Kudos
Message 5 of 7
(3,484 Views)

First, stop auto populating and use virtual folders.  Trust me OK?

 

Next create a project template2012+.  Do a search. Read the help and community nugget.  Post back with any questions.

 

Spoiler
Did I mention I love project templates?

"Should be" isn't "Is" -Jay
0 Kudos
Message 6 of 7
(3,473 Views)

Hello Jeff,

 

I am sorry I don't get what exactly is your solution. Can you please explain ? also I found the my mistake(see bleow).

 

 

Hello All,

 

I found my mistake, I was repeating adding some files double under the .lvlib which is not possible. I removed repeated files formmy physical folder and then it was working fine.

 

Thank you.

 

Best Regards,

Amit Wadje

 

-
Amit
CLAD
0 Kudos
Message 7 of 7
(3,435 Views)