Jump to content

Populating a listbox in an array of clusters programatically


Daryl

Recommended Posts

  • 1 year later...

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.

Link to comment

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

Link to comment

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.

Link to comment

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.