Jump to content

Populating a listbox in an array of clusters programatically


Daryl

Recommended Posts

Posted (edited)

I have array of clusters. The clusters have 2 elements - 1 string and 1 combo box. Can I populate the combo box programmaticly? How?

:frusty:

Edited by Daryl
Posted

As PYLB posted, you can but all array elements will have the same Item names for the listbox. To my knowledge all array elements must have the same properties outside of there value. I don't think it's possible to have listboxes with different items.

Posted

You can use references to the array element and navigate up to the list box. post-18388-0-39158100-1300211335_thumb.p

Sweet, i was soooooo close :D

of course, don't forget to close all the references at the end :cool:

;)

Thanks for the help.

  • 1 year later...
Posted

Hi,I`m new here and I want to sorry first for my english^^I have a similar problem as Daryl before. I have an array of cluster. The cluster is a Typedef with one string, two numerics, a boolean and a combo box.The entries for the array I get from an .ini file. Every line of the array is filled with different values, so also the Combo boxes have to be filled with different values.I have tried the example above, but where the "to more specific class" VI with ListBox connected is, I become an error with: Possible reason(s):LabVIEW: Type mismatch: Object cannot be cast to the specified type.I don`t know, what I do wrong. The index of controls[] array is the right one.

Posted

I have an array of cluster like shon in the picture.

Then I made a subVI, which is called for every line of the array. So in the SubVI I read out my .ini file and so on. This SubVI is called as often, as lines or elements are displayed in my Array on the FrontPanel, because I enter only one line per call of this VI... I hope you can understand what I mean.

What I also already tried is to make a reference on "Element" of my SubVI and then go the way over controls[] and so on, but this also didn`t work.

I hope somebody can help me.

Here is the array of clusters

Here is the array of cluster

post-30642-218296_thumb.jpg

post-30642-19388_thumb.jpg

Posted

Ok, Here is the part, that doesn`t really work.The Main and the SubVI is shown here. What I want is to fill the Array in the Main VI with the items of the SubVI.

Here is the Main VI

post-30642-20975_thumb.jpg

post-30642-6230_thumb.jpg

Posted

Oh, I`m sorry. Here it is.I think the problem is not to write into the combo box. I think the main issue is to have different values in every combo box of the array. I don`t know if this is possible.Thank you for your time and help so far.It would be great if you could have a look at it at the weekend.

Cluster.ctl

Posted

The controls in every element of the array need to be identical; you cannot have a different items in the combobox in different elements of the array. You'll need to come up with some other approach. One option might be a table indicator with a combobox on top of the active cell, which would let you change the contents of the combobox each time you display it in a new location. I provided some code that demonstrates the idea here: http://forums.ni.com/t5/LabVIEW/array-of-cluster/m-p/1822451#M625032 although that has a ring control, not a combobox, with constant contents. However, it would be easy to update the ring elements each time it's moved.

Posted

Hi,thank you all for your help. I also called National Instruments already and they told me the same, so I changed my program, to display the entries of the combo boxes in a different way!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.