LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

xcontrol indicator

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(3,433 Views)

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).

 

1.png 

 

 

 

Richard






Message 2 of 7
(3,420 Views)

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

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

where did you get color[4] from, I couldn't see it in LV2011 version? 

0 Kudos
Message 4 of 7
(3,392 Views)

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

Richard






0 Kudos
Message 5 of 7
(3,369 Views)
Solution
Accepted by topic author lavalava

Like this....

 

DirChNodes.png

Richard






0 Kudos
Message 6 of 7
(3,364 Views)

Another trick is that you can force an XControl to be an indicator (or control) ONLY:

 

 XControl 1_Facade 1_BD.png

Ton 

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 7 of 7
(3,355 Views)