LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure to detect the element operated in a cluster

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

phani srikanth
0 Kudos
Message 1 of 10
(5,086 Views)

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.

 

boolean in cluster.png

 

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

0 Kudos
Message 2 of 10
(5,080 Views)

... 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. 😉

 

 

 

 

Message 3 of 10
(5,069 Views)

Here's a modification that allows you to access the Boolean directly:

 

Booleans in Cluster.png

 

The Boolean reference (which gives a strict datatype) is from one of the booleans in the cluster.

Message 4 of 10
(5,065 Views)

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 <_<)

dynamic event.png

Message 5 of 10
(5,061 Views)

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.

Message 6 of 10
(2,676 Views)

@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!

0 Kudos
Message 7 of 10
(2,649 Views)

@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 🙄.

0 Kudos
Message 8 of 10
(2,619 Views)

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.

Register Cluster Controls.png

0 Kudos
Message 9 of 10
(1,743 Views)

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.

Message 10 of 10
(1,736 Views)