I have several labview projects each with more than 300 subvis. A lot of them have same vi names between the projects. When I want to combine all projects into one, I need add different prefix to the vi names to avoid conflicts. I build a vi to automatically rename all the VIs. It uses invoke node save.instrument method. However I can not get it works as "save as/ rename" with "save as a copy"=false. It always functions as "save as/a copy". I tried in Labview 2011 and 2013. Is it a bug? Does anyone has a solution?
( Labview 2011, base).
When you say that you cannot get it to work, what specifically do you mean? Do you get an error?
The Save.Instrument method will not delete the existing VI on disk, rather the Save a Copy input determines whether or not other VIs that are in memory at the time will relink to the VI at its new location. You'll still need to delete the original file once you've resaved it elsewhere.
You may also want to consider moving your VIs to lvlibs, particularly if they're already static libraries intended for reuse and the lower-level functions don't need to be or shouldn't be exposed in the project. Refer to this document for more information:
White Paper: Best Practices for Sharing and Reusing LabVIEW Code
Thank you. The save.instrment method did not report any error. My problem is the origional VI is kept and the other Subvis will link to the older one instead of the new one. Maybe I have to open all the callers before save. The codes will become a little bit complex. Let me have a try. Other methods may be simpler in code reuse. I'd like to use library if I can.