LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get cluster element when changed

Solved!
Go to solution

Hello all,

 

Iam interested in knowning (after the user changes the value of a cluster) which element inside a cluster (any type of cluster) was changed.

so in an event structure case (clustername value change) i can get ctl ref, old val, new val.

On the other side I would like to get the either the refnum or name

 

I know old and new val will need to be variant (on my function) so that i can accomodate for any cluster. I have open G installed on my machine and have looked into the Open G LV data pallet as well as a Vcluster subpanel and havent been able to do this.

 

Here is an example of a given cluster

 

rwerwer

 

Here is another cluster example:

ewefrasf

 

I have been able to do this in two different ways (always knowing before hand the cluster.

 

Method one:

asdasd

 

Method two:

sdada

 

 Here is the skeleton of the function iam trying to build(testing the different possibilities):

fafaf

 

So far I havent been successfull in this.

 

any help will be apreaciated.

 

regards,

0 Kudos
Message 1 of 14
(4,203 Views)

This will get you the name of the 1st cluster item that is different from New Val

 

Cluster Change.png

Omar
0 Kudos
Message 2 of 14
(4,177 Views)

Try this to get the old and new value along with the control name changed.

Message 3 of 14
(4,174 Views)

yes, but i still dont know which element inside the iner cluster changed.

 

example 1st cluster if i change say (electrical fault)

 

that array you sent will tell me that father cluster changed (only)

that i have been able to do.

 

thanks anyways

0 Kudos
Message 4 of 14
(4,166 Views)

No.JPG

 

as soon as I changed your cluster with mine (with cluster inside cluster) the new/old value took a dump and lv started to complain. value change is good but i need name as well (at least)

 

thanks any ways hoovah.

0 Kudos
Message 5 of 14
(4,160 Views)

Cluster in Cluster in Cluster etc...

You are going to have to recursively work down through levels of Clusters to get to the value.

 

A VI that you call recursively can walk down the cluster chain passing in the Old and new value.

There are posts about recursively walk down complex data control.

Omar
0 Kudos
Message 6 of 14
(4,159 Views)

@El_Tipo wrote:

as soon as I changed your cluster with mine (with cluster inside cluster) the new/old value took a dump and lv started to complain. value change is good but i need name as well (at least)


Yes, that is why you have to use the method that I posted.

Omar
0 Kudos
Message 7 of 14
(4,156 Views)
Solution
Accepted by topic author El_Tipo
0 Kudos
Message 8 of 14
(4,145 Views)

Omar,

 

could you add a link of such recursively walk down examples (or posts)

 

regards,

0 Kudos
Message 9 of 14
(4,144 Views)

Omar,

 

thanks for posting this.

 

Iam going to give it a try.

 

regards,

0 Kudos
Message 10 of 14
(4,141 Views)