LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically Build Button Controls

I am tring to dynamically build some buttons on a VI front pannel. Cant seem to figure out how to do this. From another VI I send in a number indicating how many buttons I will need to be made. Also, I'll be sending an array of string that contain the labels for the buttons. Any ideas???
0 Kudos
Message 1 of 4
(2,983 Views)
one possible solution is that you can have 'x' number of controls on your panel, and make them visible as needed using attribute nodes.
Message 2 of 4
(2,983 Views)
How about an array of cluster with the boolean (button) and a string (label) in the cluster. You can re-size the array via a property node and write to the strings while monitoring the booleans.

Dan Press
dan.press@primetest.com
www.primetest.com
0 Kudos
Message 3 of 4
(2,983 Views)
Rob,
I'd start off with an array of buttons and an array of string names, and a digital control(N) to set how many you want visible.
Send both arrays into a For loop with the N wired from the digital control.
Use the index array vi to pull out the # of elements (buttons & strings) per N.
Write the resultant arrays to the local variable of the original arrays.
Display the result to Front panel.

You cannot have an array with different labels for each element, so you may want to combine the 2 arrays into a cluster and work with that.
See the attached LV 6 for example.
Good luck with it, Doug
0 Kudos
Message 4 of 4
(2,983 Views)