LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set cluster's control value in subpanel

Solved!
Go to solution

Hi

 

Is there a way to set the control value of a cluster in a subpanel?

 

I enclose my vis in LV8.0

 

Charly

 

It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 1 of 7
(3,787 Views)

You can use a control reference to set the value property, or pass a value to its terminal. In short all the typical mechanisms. What exactly is the issue?

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 7
(3,784 Views)

Hi Mike,

To pass a value to a control which is in a subpanel I usually use the Invoke Method Control Value:Set. It requires the refnum of the subpanel, the value of the control and the name of the control.

When the control is into a cluster the name of the control is not found anymore. I don't see how I can access it. Do you have an example or a link for me?

Thanks

Charly 

It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 3 of 7
(3,777 Views)
Solution
Accepted by topic author CharlyStardust

If you have a reference to the VI being put into the subpanel (which you must have or it wouldn't be in the subpanel, right?) you can use that to get a reference to the VI's front panel. This in turn will let you get an array of references to all the controls and indicators on the subpanel VI's front panel. Go through this array looking at the label:text property for each reference in the array until you find the one for the control that is the cluster.

 

Now, use the To More Specific Class function to cast the cluster's generic control reference to a cluster reference. You can use it to get an array of all the controls inside the cluster. Now go through this array looking at the label:text property for each reference in the array until you find the one for the control thatyou want to set and there you are...

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 4 of 7
(3,772 Views)

Ok I see what you mean. Do you think you can access directly to the control in the cluster with just a name? something like ClusterName.Ctrl or ClusterName:Ctrl

 

Thank you

Charly

It's always sunny in California! Certified LabVIEW Associate Developer!
0 Kudos
Message 5 of 7
(3,763 Views)

No, you have to dissect the data structures like I described.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(3,761 Views)

Hi Mike,

 

can you show out the sample? b'cos i try to find of reference of the array but can't or do you have any sample regarding for this things? 

 

 

Sorry for trouble you.

 

 

Thanks

 

William Lee

0 Kudos
Message 7 of 7
(3,517 Views)