LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to create controls dynamically.

Hai,
Is it possible to create control or arrays dynamically in LabVIEW.That means i want to create controls at run time depending on the dynamic data.
Please help me in this regard.
 
0 Kudos
Message 1 of 9
(5,357 Views)
Unfortunately not...
There is no "official" method to do it. But you have three alternatives :
- use arrays of controls, and change dynamically the number of displayed elements (easiest solution)
- create as many indicators as you may need on your front panel, then make then invisible. Then make them visible at run time, depending on your dynamic data (just a bit more difficult).
- use a picture indicator and create dynamically the control pictures, detect when required the user actions, and react accordingly.
This is a relatively frequent question, already discussed on the forums, for instance here
Chilly Charly    (aka CC)
Message 2 of 9
(5,343 Views)

-> welcome back CC!  <-

If you want to "customize" the controls on the Front Panel by showing certain controls depending on operator selection, then I would go with something similar to what CC suggested.  However, with a slight change.

You can create clusters the group all the controls for a given selection.  And make the cluster visible / invisible.  It will minimize how many controls you need to change the properties.  

Please be careful when hiding controls.  There are many who abuse this property and do not comment what they are doing.  This leads to nightmare debugging the code in the future.

RayR

Message 3 of 9
(5,321 Views)
.... And if you decide to go the Picture route, I suggest you look at the "CC & Friends Emoticons.zip" (post #94)  were I implemented all of the key elements of dynamic objects intstanciation along with left and right clicks detection and the related object associations. Replace the emoticon specific functions with what your code needs and you are off.
 
Ben
 
Christian's "Create Controls on the Fly"
 


Message Edited by Ben on 05-12-2008 07:38 AM
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 4 of 9
(5,312 Views)

Waxing philosophical...

It has taken us six years to do it but we have transitioned from "There is currently no way to programmatically create controls. " too, "Yes we can."

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 9
(5,289 Views)

LOL!  Nice control fly..

I was thinking more in terms of having certain buttons being available or not available of the same Front Panel.

Actually, I forgot to mention that if there are LOTS of controls, another (maybe easier) approach would be to use TAB controls, and select which TAB page that has the appropriate controls or indicators.  You can hide the top part of the Tab (page no.), and it can fit nicely inside a decoration.

The fly is optional..  😉

RayR

Message 6 of 9
(5,275 Views)

Ben wrote:
Christian's "Create Controls on the Fly"

Just for reference, Here's the original fly post. Makes it easier to find my old stuff.

 

(Of course there could be other interpretations of "on the fly": The 1971 album cover of "Sticky Fingers" but the Rolling stones comes to mind. :D)

Message 7 of 9
(5,088 Views)

Responding to a 4 month old thread.... Have you been trasfering you old vinyl to DVD?

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(5,045 Views)
Well, the thread is old, but the topic has been in the news very recently. 😄
Message 9 of 9
(5,020 Views)