LabVIEW APIs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Relinking the missing SubVIs

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.

அன்புடன்
தமிழ் நேரம்
முதல் இந்திய ஆய்வுமெகபொப சிற்பி
சோதனைநிறுத்தம் சிற்பி
மற்ற சான்றிதழ்கள்
யாதும் ஊரே! யாவரும் கேளிர்!!

0 Kudos
Message 1 of 10
(10,466 Views)

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 :

save as.jpg

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

Antoine Chalons

0 Kudos
Message 2 of 10
(7,273 Views)

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. 

அன்புடன்
தமிழ் நேரம்
முதல் இந்திய ஆய்வுமெகபொப சிற்பி
சோதனைநிறுத்தம் சிற்பி
மற்ற சான்றிதழ்கள்
யாதும் ஊரே! யாவரும் கேளிர்!!

0 Kudos
Message 3 of 10
(7,273 Views)

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.

Marshal Horn
0 Kudos
Message 4 of 10
(7,273 Views)

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

Antoine Chalons

0 Kudos
Message 5 of 10
(7,273 Views)

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

Antoine Chalons

0 Kudos
Message 6 of 10
(7,273 Views)

I agree. Renaming in LabVIEW is much easier than relinking to renamed VIs.

Chris Bolin
LabVIEW Partner Program, CLA
0 Kudos
Message 7 of 10
(7,273 Views)

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.

http://content.screencast.com/users/kamocat/folders/Jing/media/87b3befe-906d-4a48-a869-5a4f401024d3/00000061.png

This still isn't automating the whole process, but it would make it less painful.

Marshal Horn
0 Kudos
Message 8 of 10
(7,273 Views)

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 

-----------------------------------------------------------------------------------------------------------------------------
Waiting For the inner calling 🙂


0 Kudos
Message 9 of 10
(6,706 Views)

where i can find rename vi 

0 Kudos
Message 10 of 10
(1,089 Views)