08-25-2010 05:21 AM
Hi all,
I have a Toplevel VI (let's Call it as Main.VI) and it calls 4 subVIs (Let's Call them as Sub A.Vi, Sub B.vi, Sub C.vi, Sub D.vi). Now the files in the Hard disk are changed with a fixed Suffix (Let's say YYYY is added to all VIs). So my new VIs will be Main YYYY.vi. and the SubVis will be Sub A YYYY.vi, Sub B YYYY.vi, Sub C YYYY.vi and Sub D YYYY.vi) . Now when I open the Toplevel Vi it looks for the old subVIs.
Since I know the new Sub Vi's Names. Is there a Way to programattically replace those Sub VIs and save the top level VI? any one tried this using scripting before? please let me know before I reinvent the wheel.
Thanks
Anish T.
அன்புடன்
தமிழ் நேரம்
முதல் இந்திய ஆய்வுமெகபொப சிற்பி
சோதனைநிறுத்தம் சிற்பி
மற்ற சான்றிதழ்கள்
யாதும் ஊரே! யாவரும் கேளிர்!!
08-25-2010 06:28 AM
How about doing it other way round?
If all your VIs are in the same project you can create a VI - let's call it "renamer.vi" - that open a reference to the project, then open references to the vis - as project items - (A, B, C, D) use the "save instrument and callers debug" method with the new names (A YYYY.vi, etc...)
See here :
Be carefull you have to start from the bottom of the VI hierachy
hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
08-25-2010 11:49 PM
This will work if the Vis are not renamed first. but unfortunatly the VIs are renamed in the hard disk first. Is there a work around for this situation. I would like to avoid manually opening each VI and replacing all the question marks with the new names. I would like to automate the process.
அன்புடன்
தமிழ் நேரம்
முதல் இந்திய ஆய்வுமெகபொப சிற்பி
சோதனைநிறுத்தம் சிற்பி
மற்ற சான்றிதழ்கள்
யாதும் ஊரே! யாவரும் கேளிர்!!
08-26-2010 12:23 AM
I know this isn't scripted, but can't you replace a project item with another? In LV 2009, the "find all instances" also incorporates a replace function.
If you open all the top-level VIs, then all the subVIs will be in memory, so you only have to replace each subVI once.
How to do this in scripting, I do not know of an easy way. You may have to make a "replace" function yourself.
08-26-2010 01:03 AM
Kamocat wrote:
In LV 2009, the "find all instances" also incorporates a replace function.
I'm not using LV 2009 for customer project so I don't know all the new features, but at least in 8.6 you can't use the "find all instances" on a "question mark VI". Is is possible in LV 2009?
If not that would make a cool feature idea!
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
08-26-2010 01:07 AM
If you're ready to spend time developping a script for that matter I assume it means you have a lot of sub-vis to rename, right?
Maybe you can make VI (not script) to just rename again all your sub-vis on disk to the original name they had (like if you were doing it manually from the windows explorer) and the use the method I suggested above to script the addition of YYYY in the name of sub-vis.
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
08-26-2010 08:58 AM
I agree. Renaming in LabVIEW is much easier than relinking to renamed VIs.
08-26-2010 06:18 PM
My mistake. You cannot use the "find all instances" on a missing VI, or the "find and replace" from the VI itself. However, you can use the "Replace with" from the project explorer.
This still isn't automating the whole process, but it would make it less painful.
08-14-2017 06:10 AM
Hi ,
Can someone explain how to start from bottom of hierarchy programatically.?
Or does anyone have a readymade vi to do the renaming process without affecting linking of controls and subvis
07-27-2023 11:24 AM
where i can find rename vi