LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Different Listbox values in typedef cluster

Solved!
Go to solution

Hello. 

 

I hava a multicolumn listbox in a cluster saved as an typedef.

I want to be able to create for example an array contining the typedef but I want different values in the listbox for each element in the array. 

 

So far I have only been able to update all elements to the same when I have the typedef as strict. But I want different in each element. 

 

CLDmannen_0-1601377849507.png

Main

 

CLDmannen_1-1601377911852.png

sub (I am able to reach the listbox and populate them, but I dont know how to read out the typedef as you can see in sub so I can store it)

 

CLDmannen_2-1601378078275.png

Output that I dont want

I want the array element 0 to say data1

 

How can I insert the values for each and then store it as array?

 

I have attached the project as a zip file

 

 

0 Kudos
Message 1 of 7
(1,746 Views)
Solution
Accepted by topic author CLDmannen

What are you trying to do?

 

It seems overcomplicated, but it's hard so see what you are trying to achieve.

 

The problem is that a property of a control in an array is set to each element of the array. So the Strings[] property applied to the listbox, will be the Strings[] property of all listboxes.

 

You can use a table control instead. The table control has a 2D array of strings as it's data type\value... 

0 Kudos
Message 2 of 7
(1,727 Views)

Yes but now this a control in a cluster. I have seen if I use a graph contained in a cluster which I then make an array of the clusters the property of the graph will not be the same for different elements in the array. The property is the axis. Should be the same for listbox when first contained in a cluster?

0 Kudos
Message 3 of 7
(1,722 Views)

@CLDmannen wrote:

Yes but now this a control in a cluster. I have seen if I use a graph contained in a cluster which I then make an array of the clusters the property of the graph will not be the same for different elements in the array. The property is the axis. Should be the same for listbox when first contained in a cluster?


It shouldn't work for a graph. If it does, it's a fluke.

0 Kudos
Message 4 of 7
(1,710 Views)

@CLDmannen wrote:

Yes but now this a control in a cluster. I have seen if I use a graph contained in a cluster which I then make an array of the clusters the property of the graph will not be the same for different elements in the array. The property is the axis. Should be the same for listbox when first contained in a cluster?


I've seen that also, but that's a refresh issue. If you do an invoke node: graph refresh they'll all change. I had that as a bug in an old project. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 5 of 7
(1,697 Views)

As the others said, different elements of the array share the properties. If you want it to really be separate, you can move all of the logic into a subVI and then open multiple copies of the subVI, each with its own data and display them in subpanels arranged to look like an array.

 

There is an example of this here - https://forums.ni.com/t5/LabVIEW/User-interface-problem-list-of-clusters/m-p/2311770#M726599.

 

It's fairly crude, but it does show the basic idea. Getting it to be easy to use does require some more effort.


___________________
Try to take over the world!
0 Kudos
Message 6 of 7
(1,663 Views)

If it's just the Strings[] property of a MCLB, to get a 2D grid of string in an array, I'd go for a table. You'll loose the integer value, because for a table, the selected cell is a property. You just can't win 😐

 

It's easy to get stuck in an idea, purely based on limited knowledge and expertise. There might be completely different and better UIs possible, (for instance with a tree control or subpanel,) but we'd need to know every detail of what is required.

0 Kudos
Message 7 of 7
(1,655 Views)