03-01-2018 01:43 PM
Hi All,
Everyone knows that if you need to rename a LabVIEW file (VI, lvlib, etc) you should do so within the project so LabVIEW can do all the linkage cleanup for you. Renaming a file outside of the project will cause LabVIEW to think that the dependency is missing and everything will be broken.
Now our team has several projects (roughly 30) all that access the same shared library (for discussion let's call it json.lvlib). This library is poorly name-spaced and is conflicting with another json.lvlib that exists. I want to rename our library to something like CL_json.lvlib and have this reflect across all projects, but I don't want to manually open every project and re-link subVIs.
Does anyone know of a process, tool, tip, etc that allows me to do this easily? Or am I stuck manually fixing everything?
Thanks!
----
David Ladolcetta - Certified LabVIEW Architect
DSP Tools Engineer - Cirrus Logic
03-01-2018 03:15 PM
Ooh that's tricky. You should be able to use VI scripting to do it, but I don't know of any tools that already do it...
I am interested to see what others have to say.
03-01-2018 03:24 PM
Open project X
Rename library to new name
Close project X
Open library
Rename library back to original name
X=X+1
Return to first step
You could probably use VI scripting for this.
03-01-2018 03:37 PM - edited 03-01-2018 03:41 PM
Or.....
You all are going to hate me.
Do try to be careful.
@Kyle. That just broke the library- the library members know who they belong to. projects know who they own but their members don't care who they are so, you can fool them by tinkering with their heads
03-01-2018 03:54 PM
When I make libraries I explicitly make them such that they don't know who they belong to. I thought that was pretty much the definition of how a library worked. If the library "knows" who owns it then wouldn't the library not work if any one of the 30 projects it's used in wasn't present on every computer it's shared on?
03-01-2018 04:05 PM
Jeff was saying the library members know which library (.lvlib) they belong to. So simply "renaming" the library would make all the members think the library disappeared. There is a way to "rename" the library (actually create a copy, then you can do what you wish with the old library...) without breaking it:
03-01-2018 04:28 PM
I didn't mean to just rename it on disk...
Isn't it the case that if you have the .lvlib file open and do a Save As... then choose the "Rename" option that it will rename all of its members, but that all VIs and projects not open at the time will not be informed? So if you rename it once, then rename it back again, anything not open won't known?
03-01-2018 04:43 PM
@Kyle97330 wrote:
I didn't mean to just rename it on disk...
Isn't it the case that if you have the .lvlib file open and do a Save As... then choose the "Rename" option that it will rename all of its members, but that all VIs and projects not open at the time will not be informed? So if you rename it once, then rename it back again, anything not open won't known?
Yes, that sounds right to me!
03-01-2018 04:51 PM - edited 03-01-2018 04:54 PM
You could even use read txt file and do a search and replace in LabVIEW on every .lvproj on disc...
But, you should see what the file really looks like before you automate.
Just saying, you would never write a bug I'm sure.
03-02-2018 01:28 PM
Thanks all, good tips. I think I like Kyle's idea the best if I can automate it. Editing lvproj as text files sounds dangerous. Maybe I can create a tool that does this then sell it and make a million dollars kudos!