LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rename VI in vilib programmatically

Highlighted

In a lvproj I can right click on a VI and rename it. This has the advantage of updating any referencing VIs (linking still works). I have not found a way to do this programatically.

 

I can get a list of owned VIs for a vilib, and I can Move, copy and delete those using hte usualyt file tools. But these leave the referencing high and dry.

 

Is there a way to rename VIs within a VI library?

0 Kudos
Message 1 of 7
(1,621 Views)
Highlighted

Is this a VI you created, or did it come with LabVIEW?  If it is the latter, I wouldn't touch it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 7
(1,607 Views)
Highlighted

I'm a bit confused, not sure I understand your last question.

Anyway, if you want to programatically rename VIs in a project, yes it is possible and actually not very complicated.

 

Basically you need 3 steps :

 

While the project is opened get the project reference :

2016-02-11_071834.jpg

 

Then find the item (VI or other type of item) by name to get its project item reference :

2016-02-11_071939.jpg

 

Then rename it :

2016-02-11_072053.jpg

 

Hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 7
(1,584 Views)
Highlighted

You d realize that vi.lib is listed as a dependency and is not part of your project, right?  Again, I'd be very careful mucking around inside that folder.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 7
(1,564 Views)
Highlighted
  1. You should never put custom sources in vi.lib.
  2. You should never alter sources in vi.lib without having a backup. even then, it is highly questionable.
  3. You should place custom sources for projects either in the project folder or in user.lib.

Point is that vi.lib is "property" of the LV installation. Modifying the LV installation (e.g. installing a toolkit) can "reset" all changes you have done yourself in that folder.

 

Norbert

 

EDIT: If you mistake vi.lib for lvlib, then above mentioned points are still true, but most likely will not apply to your question.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 7
(1,550 Views)
Highlighted

I can't seem to get this to work with 2013. 

 

I want to do the following:

 

1) Copy a project to a new location (DONE)

2) Rename a class within this project to a new name.  (I get invalid VI reference when I try your method)

3) Rename the library that contains this class.  (Have not tried this yet)

 

Thanks!

 

PS.  I think the other people are confused but I don't think the person was asking about changing vi.lib just vi libraries or lvlibs.  I think they saw a period where there wasn't one.

0 Kudos
Message 6 of 7
(1,511 Views)
Highlighted

Thanks TiTou: I did manage this same solution. The trouble I was having was that I renamed a .ctl file, and then the other VIs did not see it anymore. My solution was to use scripting to replace that control in the calling VIs. Renaming within hte project (non-programatically), did not cause this same problem. Or at least I don't think it did. 

 

(OS, I mean lvlib in theoriginal desciption of my problem. I see this confused several people.)

0 Kudos
Message 7 of 7
(1,494 Views)