Jump to content

Copying top level VIs and subVIs


Recommended Posts

Hi all,

I have a top level VI. It contains many (to me, ~50) sub VIs. It is a test template which can be used as a building block for producing different yet similar test applications. When a new requirement for a new application comes in, I start by renaming (usually by adding a prefix for the new job) the test template's top level VI and all its subVIs. I then have have to go through the new, renamed top level VI and tell it to point to (replace with) the new, renamed subVIs (for all ~ 50 subVIs) and not the old, original template ones. Very tedious indeed. Surely this can be done with some code?

The best I've managed so far is to rename and copy my top level and subVIs, but of course, the renamed and copied top level VI still points to the original subVIs. How can I get it to point to the newly renamed and copied subVIs?

I attach a VI that is my sum achievement to date.

Awaiting inspiration, Graeme.

Link to comment

QUOTE(PJM_labview @ Aug 23 2007, 08:43 PM)

Nice!

How can I knock an idea like that after i wrote a similar VI.

While mine alos does the cloning and adding a prefix it does not allow specifying an existing prefix. On the other hand, mine support morphing durring the cloning by which I mean it will replace all instances of one object (VI or ctl) while doing the morphing.

The trick to cloning (manually or programatically) is saving "from the bottom up" and therein lies the challenge of writing a cloner. For this work I used the "callers" and "callees" properties and reshuffled the list as indicated.

I will not post mine because it has a "face only a mother could love". :P

Nice PJM!

Ben

Link to comment

QUOTE(PJM_labview @ Aug 23 2007, 07:43 PM)

PJM is this package also "relink" all the project VI, after change the name?

Actually i used tool from Martin Vernhout, martin.vernhout@philips.com, lvdevtools.sourceforge.net and its work very well

Ciao

Link to comment
  • 1 month later...

PJM_labview,

Many thanks for your postings to my topic and my deepest apologies for the outrageous delay in replying to you. Pressure of work and other LabVIEW projects have side-tracked me, but I hadn't forgotten the issue. Only this evening (well evening in the UK) have I had a chance to seriously look at your solution. However, I can't get it to work for me. Undoubtably operator error, of course. I was hoping if you, or others, might enlighten me. I've tried to attach a .png which shows the error message I see. I've not tried this before so if it all goes wrong, apologies and I'll re-post with something else. Many thanks again.

Regards, Graeme.

Link to comment
  • 1 month later...

After much thrashing around I've come up with something that does exactly what I want. It's a bit rough and ready, though, but demonstrates the principle. I'm posting it to see what others think. Hopefully, it might be of use to others too, even if only as a basis for something better. Constructive criticism most welcome.

Regards, Graeme.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.