LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically generate a new front panel object

I'd like to see an example of how to programmatically generate a new front panel object like a button or sub-panel at run time.  Any pointers?

 

I've looked for examples but don't seem to be having success.

0 Kudos
Message 1 of 6
(5,369 Views)

Hi,

 

Actually you can't ! LabVIEW doesn't allow dynamic control creation. It must know how many controls needs to be loaded at run-time.

 

There is a trick where you can use subPanel and re-entrant VIs but this is not really dynamic.

 

Also if you don't plan to compile your VI you might be interested in VI Scripting to dynamically create controls in VIs.

 

Regards,

Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
0 Kudos
Message 2 of 6
(5,360 Views)
Message 3 of 6
(5,354 Views)

"Controls on the fly" (artwork courtisy of Christian Altenbach) is something I have done on more than one app.

 

ControlsOnThe Fly.png

 

Also check out the Picture control thread for more links and idea.

 

The easy method is to pre-create and hide.

 

The amount of code that goes into supporting functional controls is enormous (been ther done that)

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(5,311 Views)
Message 5 of 6
(5,281 Views)

 


@paul_a_cardinale wrote:

Try this.


This is great, thank zou very much! This is exactly what I needed for a labview code generator!

0 Kudos
Message 6 of 6
(4,875 Views)