LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

automatic creation of drop down box

Is it possible to analyze a string input and have it's data create a drop down box of some kind?
 
For example, if my string reads "Enable Disable Manual_Enable" is there a way, while the program is running, to create a drop down box (or anything that has similar properties as one) to have the three choices listed in the string?  I haven't been able to find a way for something to be created once the program is running.  I'm not sure if LabVIEW is able to do this but I appreciate any help I can get. 
 
Thanks
0 Kudos
Message 1 of 6
(3,219 Views)
Hi!
   Of course it is possible.

   Let's consider a Ring, which I've already used this way.  On Function block, right click over the control, and select "create property node".  You'll use property node to set strings of the ring.  Go on the new created property node, right click over property, and select "property --> String and values".   This is a way.

   String and values should be an array of cluster, each cluster being a string and a control. 

   Of course, the control has to be created during developement time, you can't create it run-time with LabView  Smiley Sad ("on the fly")

   Hope this can help.

graziano
0 Kudos
Message 2 of 6
(3,217 Views)
You can use a ring control to create drop down lists that can be populated during run time. To populate the list use the 'strings[ ]'  property node. This takes an array of strings and adds each element as an entry in the list.

If you have a single string that contains the different items you want to use then you'll need to seperate them into an array of individual strings first. Use something like scan string for tokens, or string to spreadsheet array. Make sure you have the correct delimiter on the spreadsheet string to array function.

See the attached vi

Hope this helps
Dave
Message 3 of 6
(3,203 Views)

Just to clarify the difference between Graziano's and my replies:

You can use either the ‘strings[]’ or the ‘strings and values []’ properties to populate the list. The difference is that ‘strings and values []’ allows you to set a specific numerical value to each entry. With ‘strings []’ labview will use a fixed set of values, which by default are 0,1,2,3…

Dave

0 Kudos
Message 4 of 6
(3,189 Views)

Thanks for the ideas.  I'm not sure how it will work in my vi but I will just have to mess around with it and see what I can do.

Thanks again! 

0 Kudos
Message 5 of 6
(3,182 Views)
Hi!
   if you have problems, just post what you coded, then it'll be easier to help you!

graziano
0 Kudos
Message 6 of 6
(3,174 Views)