LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

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

Hi kisyou,

 

save that "basic" VI (and it's hierarchy) in a different place!

(File -> Save as…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 11 of 16
(921 Views)

Dear GerdW,

 

But the subvi do not have a file name.  

0 Kudos
Message 12 of 16
(916 Views)

Hi kisyou,

 

LabVIEW basics: every (sub)VI has a name!

(Do you know how to use the context help window opened with Ctrl-H?)

Best regards,
GerdW


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

Hello,

 

I need to rename the Main VI and  SubVIs.

Based on your method, only can rename the Main VI, the subVIs are just copied to a new destination. 

Why I need do this work, because sometimes I need to modify the the subvi in different projects.  

0 Kudos
Message 14 of 16
(906 Views)

Hi kisyou,

 

Based on your method, only can rename the Main VI, the subVIs are just copied to a new destination. 

Once the mainVI with it's own set of subVI is in its own location you can rename the subVIs (after putting all together in a project)!

 

sometimes I need to modify the the subvi in different projects.

This sounds wrong to me: you need to copy a whole hierarchy of VIs because you need to edit some subVIs down below?

There are surely better methods to solve such problems! (One of them would be to use some OOP architecture…)

Best regards,
GerdW


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

Hi kisyou,

 

Yes, I did.

I did that in a project where different VI's with their subVIs are saved in separate libraries (I called them Objects).

The duplicator "DuplicateObjectsMain.vi" is very sophisticated and it owns to my company so I am not allowed to publish it here. It takes too much time to detach the code and make it a separate one which I can publish here.

I can say the basic principle is to use references to each project item (object library) then manipulate them.

I think have spent more than one full week 8 hours per day to get it running.

It is a lot of effort and you should analyze first if it has sense to do it.

In our case it was useful because so called objects are parts of the big sequencer program which control different hardware devices (power supplies, oscilloscopes, signal generators, ....and so on...). To be able to use two or more same devices it was necessary to duplicate their code. Each object device contains in its library hundred of drivers so it is very hard to rename all of them manually 🙂

Anyway it was a lot of work....

 

0 Kudos
Message 16 of 16
(899 Views)