LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use invoke node method to rename vis?

Hi,All,

 

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? 

 

Thanks,

Jacky

( Labview 2011, base).

0 Kudos
Message 1 of 3
(971 Views)

Hello Kayaoo,

 

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

http://www.ni.com/white-paper/9648/en/

 

Regards,

Tom L.
0 Kudos
Message 2 of 3
(959 Views)

Tom,

 

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.

 

Best regards,

Kayaoo

0 Kudos
Message 3 of 3
(947 Views)