12-11-2008 01:07 PM
Solved! Go to Solution.
12-11-2008 01:29 PM
Cross-Post, (with a good solution)
It is considered good manners to include the other posts link as well.
Ton
12-11-2008 01:45 PM
Thanks for your post, am new but not sure whether posting in two separate forums (I assume LAVA and NI's Forums.ni are separate entity) is ok with this forum?
But I do agree with posting a link on both forums to link possible solutions. Thanks, shall keep that in mind for future posts!
I tried on the variants and came out with a possible solution but not the best, and exploring better ways of doing it.
As I get a better solution I shall mark it as a solution!
Link to another forum with possible solution - http://forums.lavag.org/How-to-programatically-determine-type-of-controls-in-a-cluster-t12631.html&p...
Thanks and Regards,
Tirthankar De
12-11-2008 02:37 PM - edited 12-11-2008 02:39 PM
If you want to use the Controls[] property have a look at the 'Class' value of each reference:
To remove the border of (any) modern control, right click the border, select the brush tool, select the Transparant value (upper right corner), if you still see a little border hit 'Space' to select front and background color.
To see what can be done with the variant data from a control have a look at this custom probe. Where I use OpenG tools to get all the possible info on the data.
Ton
12-11-2008 04:56 PM
Dear All,
With inputs received so far, I have deduced a solution to my problem (see attachment)!
Steps to achieve it:
1] Select the "Controls[]" property of the cluster
2] Use an auto indexed for loop to act on each control refnum.
3] Select the "Class Name" property of the control refnum to identify type of control - Enum/Boolean/etc.
4] Use a case structure to act on basis of individual control type.
5] Using To More Specific Class Function VI typecast the control refnum to identified refnum
- Use class specifier constant as type for typecasting, found in AppControl
For case of Enum, below are the steps.
5a] After placing class specifier constant, select Enum instead of generic refnum constant by clicking on the constant.
6] To get the value of index selecetd, use "Value" property to get value which is in variant format, so use variant to data VI to get the desired data.
7] To get the string of selected item, use "RingText.Text" property.
Similarly other controls can be accessed programatically on the runtime!!
A special thanks to TonP for Tip on controls to class !
Thats all folks!!
Regards,
Tirthankar De
12-11-2008 05:18 PM
I found a link having information on somewhat similar line:
http://wiki.lavag.org/Control_References#.E2.80.9CFront_Panel.Controls_.5B.5D.E2.80.9D_Property
I have modified the solution to incorporate the best practices!
I shall update this link in LAVA forum so people benefit from this!