LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming files used across multiple projects

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

 

0 Kudos
Message 1 of 14
(3,147 Views)

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.

0 Kudos
Message 2 of 14
(3,119 Views)

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.

Message 3 of 14
(3,116 Views)

Or.....

 

You all are going to hate me.

 

  • Open the library and rename it
  • Save the library (fixing all the library linkages)
  • Close LabVIEW
  • Open your projects in any text editor
  • Search for "OldLibName" and replace with "NewLibName"
  • Save and close

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


"Should be" isn't "Is" -Jay
Message 4 of 14
(3,113 Views)

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?

0 Kudos
Message 5 of 14
(3,102 Views)

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:

capture.png

0 Kudos
Message 6 of 14
(3,098 Views)

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?

Message 7 of 14
(3,093 Views)

@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!

0 Kudos
Message 8 of 14
(3,089 Views)

You could even use read txt file and do a search and replace in LabVIEW Smiley Very Happy 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.


"Should be" isn't "Is" -Jay
Message 9 of 14
(3,087 Views)

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!

Message 10 of 14
(3,055 Views)