08-01-2013 05:48 AM
Hello.
I have a Library which I am trying to use as a template. The library consists of three sub libraries as follows
Template.lvlib
---SUB-A.lvlib
---SUB-B.lvlib
---SUB-C.lvlib
I am writing a tool which will import this library to my project with a different name as it will be imported multiple times. So I can programmatically save a copy of the top level library and add it to the project so I end up with the following.
Instance A from Template.lvlib
---SUB-A.lvlib
---SUB-B.lvlib
---SUB-C.lvlib
I now want to change the name of the Sub Libraries to something as follows.
Instance A from Template.lvlib
---Module-A SUB-A.lvlib
---Module-A SUB-B.lvlib
---Module-A SUB-C.lvlib
Now here is the crux of my problem. If I change the name of say SUB-A.lvlib by doing so in the project explorer manually, the file is renamed and everything works ok. I want to do this programmatically but when I try to do so the libraries are not added / compiled properly and the vis within the libraries are broken. What is it I am doing wrong.
The first part of the code (Not disabled) copies in the library + sublibraries from the template file. The second part is what doesnt seen to work.
Thanks in advance
Craig
08-05-2013 04:24 AM
Hi Craig,
Good morning, I hope you are well. Thank you for your post.
In order to assist with your question regarding importing a .lvlib from a Template whilst renaming the sub libraries would it be possible to post an example section of code including the disabled element as shown in your Block Diagram screen capture. This will assist in the experimentation required to allow for the desired functionality.
Enjoy the rest of the day.
Best Regards
09-17-2015 11:13 AM
I am trying to do the exact same thing. What was the solution?
10-16-2015 07:46 AM
Hi sparklehose.
I never did find a solution although I am sure there probably is one for doing this. In the end I did eveerything manually rather than from a wizard (Which was the original intent for this code).
Craig
10-16-2015 07:59 AM
I think the trick is that after you do the rename of the library, you need to open all the references to the libraries members, and invoke a save instrument. Because when a library changes its name, all of its members namespace changes, and they need to be resaved. Sorry I don't have an example of this on hand at the moment.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-16-2015 11:19 AM
If it helps, there are some VIs for programmatically renaming libraries here in LabVIEW 2012 and later:
LabVIEW 20xx\vi.lib\Utility\EditLVLibs
I discuss these VIs (and many, many more) in my Hidden Gems in vi.lib presentation.