LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a VI by Clicking

Hi. I'm quite new with Labview.

 

Does anybody know how to create/ duplicate a VI by clicking a button in the front panel?

 

What I mean is: I have created a template, and I want to write a program such that whenever I click a control button in the front panel, a new VI will be created  automatically, exactly like my template. Can anyone tell me how to do this? I know I can programmatically create a new VI by using Labview VI scripting, but it seems very complicated.

 

Thank you.

 

 

0 Kudos
Message 1 of 12
(2,846 Views)

You mean that while the code is running or in the edit mode....? Can you tell what exactly you want to achieve by that?....Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 12
(2,839 Views)

Are you familiar with the template browser?

This is the dialog which shows up if you select File>>New. (No key shortcut).

 

You can include your own templates there.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 12
(2,838 Views)

What I mean is: At first I create a template VI. Then with my main VI running, by clicking a button in my main VI, a new VI with its front panel will pop up. This new VI is exactly like the template VI. And I can fill in extra information in the VI, for instance the operating condition of a machine.

 

Can I do it by using the VI server?

0 Kudos
Message 4 of 12
(2,826 Views)

Nobert,

 

I intend to create a new VI while my main VI is running.

 

 

0 Kudos
Message 5 of 12
(2,824 Views)

It is still not clear if you talk about the development phase of the application or if this should be a feature of the running application.

If you are talking about development, i suggest you to use the template browser as "main VI".

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 12
(2,820 Views)

Nobert,

 

It is a running feature of an application. I had created a few subVIs, and I want to create a "main VI" such that the "main VI" will create these subVIs.

 

Can I use the "open VI reference" to open these subVIs, and save these subVIs under another name, and then open these newly saved subVIs and let it run independently? but how exactly to do it?

 

Thanks for your advice. Smiley Wink

 

 

0 Kudos
Message 7 of 12
(2,816 Views)

By the method you proposed you will be able to create a new vi but you will not be able to do any coding there you can simply see the front panel and check the values. And Without running the VI you cannot pop up another VI's Front panel.

 

By using the Open VI Reference you can invoke the VI into the main VI and can do some operation with respect to the VI and it has nothing to do with coding while the Main program is running..

 

Smiley Wink

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 12
(2,808 Views)

Please take a look into this nugget. It should shed some light on the question for you.

 

Please note that adding functionality to the called VI during runtime is not possible (at least not in a supported, stable way).

 

hope this helps,
Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 9 of 12
(2,807 Views)

If you have the path to the VI you want to copy and the path of the new VI, open the original using Open VI Reference, then use the Save Instrument method to save to a new location.  Make sure you set the Save A Copy flag to TRUE.

 

CopyVI.png

0 Kudos
Message 10 of 12
(2,768 Views)