LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically add multiple items within an array of Combo Boxes or Rings

(Novice programmer that completed Core1 and 2) 

 

I know how to programmatically add items within a Combo Box or Ring by using property nodes (On block diagram; Create-->Property Nodes-->Strings [ ] ).  How can I programmatically do this to an array of Combo Boxes or Rings?  I'm developing an app and I want to add this feature without having to place one Combo Box at a time side-by-side on the GUI.

 

Below are reinitialized controls on my front panel.

FarmerJ_1-1673487806405.png

 

Below is the block diagram of a sample of my attempts.

Combo Box: I experimented with using text (which is similar to Value).

Combo Box 2: I discovered how to use the "Strings []" property node.

Combo  Box Array:  I can only get it to insert the Value (front panel string value).

Combo Box Array 2: I tried using a local-variable but it acts like the Value property node. 

 

FarmerJ_0-1673490824123.png

 

 

I also manually inserted my items in the properties window of my front panel just to make sure I can still have that ability even though it's an array.  I found that the items inserted will propagate to all other elements within the array control.

 

I pondered on this further, and I think I realized that the properties seemed to be inherited by the array control (from my little understanding of OOB/parent-child concepts).  So, it seems as if I needed to create a reference to the first element of that array and convert it to a Combo Box so I can then access/change the Strings [] property...?  But then I wouldn't know how to put it all back together.  I attempted to do something like this in the new block diagram snipit above.  Towards the bottom of the block diagram, you'll see where I attempted to use a refnum of the array element, but it still only gave me the option to edit the value.  Was I getting close???

 

 

 

0 Kudos
Message 1 of 5
(1,155 Views)

See Accessing Properties and Methods of Array or a Cluster Elements

-------------------------------------------------------
Control Lead | Intelline Inc
Message 2 of 5
(1,138 Views)

I'm also have the same question before and I put two Array in the program...

thanks for the information.

0 Kudos
Message 3 of 5
(1,128 Views)

Thank you for the quick reply!  So it looks like the class specifier is what I was missing when implementing my last attempt.  Sounds promising.  I’ll post results tomorrow morning.

0 Kudos
Message 4 of 5
(1,118 Views)

@ZYOng

 

The link you sent worked perfectly!  Thank you!  

 

I tried doing a search myself but couldn't find what I was looking for.  Appears that I still don't know LV well enough to search for the right keywords.  I tried "Combo Box [or Ring] properties in an array", "inserting items in combo box in an array", etc.  Helps when you have better knowledge to specify your search more accurately.  On a positive note, one of the pages showed me how to use "search engine" like history feature in a Combo Box.  Can't use it in my current application but interested in future projects.

0 Kudos
Message 5 of 5
(1,059 Views)