From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to duplicate and rename programatically the basic VI and all his subVI

Hello everybody!

 

In my sequencer I used a basic VI to control a device. This basic VI has 100 subVI's, most of them use some shift register and clusters for handling data.

Now I have to use simultaneously 2 devices of the same type (so I'm afraid that is not a good idea to use same subVI's for both devices because I can get wrong results).

I need two different names for my devices to control them separately via GPIB.

So I want to duplicate  this basic VI control and his subVI's using new names (old name+index2 e.g. read.vi=>becomes read2vi). Of course the new duplicated VI has to use the indexed subVI's.

 

The solution I used in the past is to open the basic VI save it using new name...... and then...... repeat this operation for each subVI. This takes a lot of time and each time when I change somethings in the VI, I have to change the same in the duplicate VI. Some times other persons makese the changes and is very difficult to verify if the changes are also done in the duplicate VI.  

Can I do this programatically? 

 

Or there is another way to solve my problem?

 

Thank you!

 

 

0 Kudos
Message 1 of 16
(3,201 Views)

Hi Nicku,

 

and when you get a 3rd device you create a 3rd copy of the whole hierarchy to control that device too?

 

Instead you could:

- use VI templates instead

- make an array of measurement data and use your VIs in an autoindexing FOR loop

- separate data aquisition from data analysis to ease point 2

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 16
(3,193 Views)

Have a look at the OpenG stuff. With he OpenG builder you can create a developement distribution of your BasicVI (containing all SubVIs) and namespace it, e.g. postfix 2. There is also a vi Unmangle Names and Mangle Names to write your own code to do so.

 

Felix 

Message 3 of 16
(3,185 Views)

Thanks GerdW but how to use VI Templates with 100 subVIs?

 

 

Felix Thank you for your replay but I do not have enough time to learn new things.

 

 

Nicu

 

0 Kudos
Message 4 of 16
(3,159 Views)

Nicku wrote:

 

Felix Thank you for your replay but I do not have enough time to learn new things.

 

 

Nicu

 


HUH?!  Actually, felix is dead on-  While I avoid the openG functions I am aware of what they have.  And Felix put you right on the tool that will do what you asked.  

 

Of course, if you haven't the time to learn new things why did you post?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 16
(3,153 Views)

Thinking that you need VIs of different names to control two different GPIB instruments is just plain wrong thinking. Each instrument is addressed separately. You can never get results from one when you expect results from another. GPIB just does not work that way. In most cases, you can't even simultaneously read or write to two different instruments.

 

Forget about renaming all of those VIs and worry about something else.

0 Kudos
Message 6 of 16
(3,144 Views)
Message Edited by esmaham on 03-29-2010 05:14 PM
0 Kudos
Message 7 of 16
(3,090 Views)

Dear ,

 

Do your solve your questions?  can you explain for me ?  thanks again.

0 Kudos
Message 8 of 16
(2,534 Views)

Hi kisyou,

 

Do your solve your questions?

Who is "you" you are talking to?

There were several suggestions in this old thread 8 years ago…)

 

can you explain for me ?

Explain what?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 9 of 16
(2,529 Views)
My question is : How to duplicate and rename programatically the basic VI and all his subVIs?
0 Kudos
Message 10 of 16
(2,523 Views)