01-13-2012 02:12 PM - edited 01-13-2012 02:13 PM
When changing an instance of xcontrol from control to indicator, the instance is changed to indicator from the block diagram but not in the front panel. How do I do that so it changes from the block diagram to indicator along with proper color code, i.e. it should be grayer? Is it because I'm using a cluster as my xcontrol?
Solved! Go to Solution.
01-13-2012 03:54 PM - edited 01-13-2012 03:58 PM
In the Facade vi of your XControl, in the Direction Change case, put a Case Statement (or Select). Use the indicator? unbundle to differentiate Indicator (T) or Control (F), and in the case statement (or from the Select), use the Colors[4] PN, to change appearance of the control when it becomes an indicator or control (i.e. changes direction).
01-13-2012 06:38 PM
also how do you change the direction of the xcontrol from the front panel? for example, if my xcontrol is a cluster of enums then the increment buttons should disappeared and user shouldn't be able to make any selection after the control was changed from control to indicator. thanks
01-14-2012 01:34 AM
where did you get color[4] from, I couldn't see it in LV2011 version?
01-17-2012 09:58 AM - edited 01-17-2012 10:02 AM
lavalava,
The Colors[4] is for a boolean button. Using an Enum, the property would simply be Color.
I have attached an XControl which does the bare minimum of what I think you want insofar as changing direction. There may be a better way. I'm sure there's a better way, but I hope it helps.
edit: I forgot something. Also add a Disabled (but not grayed out) PN on the elements of the cluster, switched on and off according to Indicator or Control, so that the user can't change stuff if it's an indicator
01-17-2012 10:11 AM
Like this....
01-17-2012 12:00 PM
Another trick is that you can force an XControl to be an indicator (or control) ONLY:
Ton