09-29-2020 06:18 AM
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.
Main
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)
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
Solved! Go to Solution.
09-29-2020 06:52 AM - edited 09-29-2020 06:52 AM
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...
09-29-2020 07:01 AM
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?
09-29-2020 07:39 AM
@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.
09-29-2020 08:39 AM
@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. 🙂
09-30-2020 09:28 AM
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.
09-30-2020 09:53 AM
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.