01-22-2009 05:47 PM
Hi
Is there a way to set the control value of a cluster in a subpanel?
I enclose my vis in LV8.0
Charly
Solved! Go to Solution.
01-22-2009 06:11 PM
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...
01-22-2009 06:56 PM
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
01-22-2009 07:10 PM
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...
01-22-2009 07:25 PM
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
01-22-2009 07:29 PM
No, you have to dissect the data structures like I described.
Mike...
08-26-2009 03:14 AM
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