09-24-2014 07:43 PM
Hi,
i have a cluster with #60 booleans in it with all different labels (1...60).
i have created a event (for whole cluster, not added individual 60 elements) in event structure to find the label of the element.
when i try to fetch the label.text, i am able to get only the cluster label not the element.
please give suggestions,, so that i wil be able to extract the individual label in a cluster.
Thanks in advance
phani
09-24-2014 08:08 PM
phani,
If you create a value changed event for each boolean you can get the labels easily. But that will get messy to do for 60 booleans.
You can also use the Value changed event for the cluster as a whole and then find the changed element. The attached VI will do that provided that the cluster contains only booleans. Cluster to Array will not work if all the elements of the cluster are not the same type and a type which can be an array element.
Lynn
09-24-2014 09:20 PM - edited 09-24-2014 09:22 PM
... and if you don't want to deal with all these references and prperety nodes inside the event structure, you could do as follows. same difference. 😄
...and if the cluster is of mixed datatype, wire the output of search array to a case structure and act according to the changed element.
Personally, you might want to use an array of boolean instead, simplifying the code even more. 😉
09-24-2014 09:30 PM
Here's a modification that allows you to access the Boolean directly:
The Boolean reference (which gives a strict datatype) is from one of the booleans in the cluster.
09-24-2014 09:43 PM - edited 09-24-2014 09:45 PM
Since you seem like you just don't have enough options yet, you could also go for dynamic events 🙂
EDIT: Noooooooooooooooo, missed it by 2 seconds (or 10 minutes, and the forums just didn't refresh properly <_<)
10-26-2021 06:12 PM - edited 10-26-2021 06:14 PM
Additionally, when we have multiple cluster in the same UI and want to capture for multiple cluster with same event structure, we need to build both cluster's control together and register the event.
10-27-2021 12:18 PM
@LogeshKumar453607 wrote:
Additionally, when we have multiple cluster in the same UI and want to capture for multiple cluster with same event structure, we need to build both cluster's control together and register the event.
You are replying to a 7 year old discussion with a cryptic ambiguous sentence (e.g. what is the meaning of "build together"?). If you think you have something to contribute, please provide details and example code. Thanks!
10-28-2021 04:51 AM
@altenbach wrote:
@LogeshKumar453607 wrote:
Additionally, when we have multiple cluster in the same UI and want to capture for multiple cluster with same event structure, we need to build both cluster's control together and register the event.
You are replying to a 7 year old discussion with a cryptic ambiguous sentence (e.g. what is the meaning of "build together"?). If you think you have something to contribute, please provide details and example code. Thanks!
I kudod the post anyway. Can't expect too much from a first post.
I just hope it isn't some automatic post to build up credibility to post spam 🙄.
02-23-2023 10:35 AM
I know this is an old post, but I came across it looking for a similar solution. I believe what they meant was concatenating two "Controls[]" arrays together. I've expanded on this solution slightly and will post here in case someone else ends up looking for a similar solution. A few notes: you can give the event a more meaningful name by using the variant to data cluster and naming the constant. If you want to handle the control in a subvi, you can pass the reference and use "cast to more specific class" based on the label text. If you have controls with the same name in different cluster, you can use the name of the cluster to differentiate.
02-23-2023 10:50 AM
Also note that the variant value has the label of the control.
So you can use Get Type Information.vi (use QD) to get the label from the variant.
This is probably slower then using the reference, but if your processing in a subVI, you only need to pass the variant, not the variant and the label. Of course if you also want the cluster name, you'd need to use the reference anyway.