LabVIEW APIs Discussions

取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 10 条)
14,800 次查看

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 项奖励
2 条消息(共 10 条)
11,607 次查看

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 项奖励
3 条消息(共 10 条)
11,607 次查看

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 项奖励
4 条消息(共 10 条)
11,607 次查看

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 项奖励
5 条消息(共 10 条)
11,607 次查看

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 项奖励
6 条消息(共 10 条)
11,607 次查看

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

Chris Bolin
LabVIEW Partner Program, CLA
0 项奖励
7 条消息(共 10 条)
11,607 次查看

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 项奖励
8 条消息(共 10 条)
11,607 次查看

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 项奖励
9 条消息(共 10 条)
11,040 次查看

where i can find rename vi 

0 项奖励
10 条消息(共 10 条)
5,423 次查看