LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change attributes of controls inside an array of clusters

Hello,

I'm writing an application which has to control 36 little devices.
To visualise this i have created an array of clusters, each cluster containing a button, a checkbox and a string on the front panel.
I have a event structure to detect user input in this array, but how can i read an edit properties of the controls inside these clusters?
As example, i want to change the color of the button when the user clicks on the checkbox.
All i get is that all buttons in the array change in color, not just the button in the same cluster as the clicked checkbox.

Best regards,
Frank Reijnen
Message 1 of 17
(6,116 Views)
Unfortunately, I don't think it is possible.

I'm fairly sure that all elements in an array share the same properties. That's the very nature of an array - a repetition of a data structure.

I thought it might be possible to construct a cluster of clusters - but unfortunately, although you can access an array of references to the sub clusters, it doesn't appear that those references can get at many of the properties of the sub clusters.

Sorry.

Mark H.
0 Kudos
Message 2 of 17
(6,103 Views)
Mmmhh, that's strange.
An array is indeed a repetition of data structures, but (at least in the programming langues i'm used to)
properties are a bit of data. So all elements of the array have the same properties, but the value of the properties
can be different. (This is object oriented). So Labview doesn't support this? That's a big dissapointment....
Thanks for you answer anyway.
0 Kudos
Message 3 of 17
(6,102 Views)
You're not the only one disappointed by this.
You can make a suggestion to have an array where the properties won't be the same for all elements in the LV.

___________________
Try to take over the world!
0 Kudos
Message 4 of 17
(6,102 Views)
Hi freijnen,

It is possible, just not pretty!

Maybe there is an easier way of doing this... This would be good for a developer challenge 😉

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 5 of 17
(6,098 Views)
Why is a cluster of clusters not a solution?

That would let set any property any way.

A bit confused,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 17
(6,090 Views)
Because i would like both options....setting each property indivually, and for all elements at once (by using a simple for loop).
0 Kudos
Message 7 of 17
(6,085 Views)


freijnen a écrit:
Mmmhh, that's strange.
An array is indeed a repetition of data structures, but (at least in the programming langues i'm used to)
properties are a bit of data. So all elements of the array have the same properties, but the value of the properties
can be different. (This is object oriented). So Labview doesn't support this? That's a big dissapointment....
Thanks for you answer anyway.




I'm feeling apologetic...
In LabVIEW, controls are visual objects to display the data; they are not the data. While it is easy to handle an array of say 10000 DBLs, an array of 10000 controls plus their numerous and different display properties would rapidly eat up available memory. Since you won't ever display 10000 controls on screen simultaneously, it is a waste to allocate memory for display properties.

If you need to display different colors according to the value of your data, set the button to transparent and put it over a colorbox. You have to make the color/display properties as part of the data.


LabVIEW, C'est LabVIEW

Message 8 of 17
(6,072 Views)


Ben a écrit:

A bit confused,




Now you are in fuzzy logic, Ben? 😉


LabVIEW, C'est LabVIEW

Message 9 of 17
(6,069 Views)
Ok, let me try to explain what I would like to do.
I have a test machine which can test 36 little electronic devices at the same time.
And I would like to visualize this test machine in labview to make it easy to operate for the testoperator.
The test machine is visualized by 36 blocks, each containing a string input field.
The test operator has to enter a serial number in each of the string input fields, and then push a button
to start the test.
Colors are used to show the status of each of the 36 devices. Green = test passed, red= test failed, blue = not tested yet,
yellow = test in progress, ect.
So what I need is an array of clusters, and in each cluster a string and somekind of colourfield. And then I would like to be
able to read the data (the serial numbers) in something like a while loop, but also I'd like to set the color of each field
independently, by using the array index (otherwise I must wire all of the 36 fields....)
This IS possible with Visual basic, Delphi, C builder, ect. (text based windows programming langues), so I expected this to be possible
in Labview also.
Mr. Drolet, I don't understand your argument. Nobody needs to show an array of 10000 controls, but an array of 10000 integers is quite feasable.
This will take a memory space of 10000 x the size of one integer.
A array of, lets say 50 visual controls on one screen can be needed in some applications. This will need a memory of 50 x the memory size of one control, including each of the property's of that control. This is less then the space needed for 10000 integers...

Thanks for your suggestion Mr. Drolet. But can I acces the color property of a colorbox if it's part of a cluster inside an array of clusters?
(as you might have noticed, I have experience with visual basic, but i'm new to Labview.)
0 Kudos
Message 10 of 17
(6,038 Views)