views:

161

answers:

2

In LabView 2009, is there a way to have one control (slider) affect the output and display of another control (slider)?

For example, there are two sliders that adjust two separate parameters. I would like to be able to adjust the parameters independently but also simultaneously adjust both with a separate (parent) slider. The change in value created by the parent slider would be represented by a change in the two independent sliders for each parameter.

+4  A: 

If I understand you correctly you have three sliders.

  • parent
  • childA
  • childB

A change in parent will be sent to childA and childB. A change in childA or childB won't affect the others.

If this is correct you will need to register to the 'Value Change' event of parent. When the event is triggered you sent the value to childA and childB with a 'Value (signalling)' property node. The value signalling will make sure that 'Value Change' events of the children get triggered as well. When you move around the slider the children will follow.

Option B when you need the three sliders to always be the same you can do that quite easy with the following steps:

  • Place a slider
  • Right click, visible items-> digital display
  • Right click on the slider -> Advanced -> Customize
  • Right click on the digital display-> Replace -> a Slider (child A) Do the same exercise for Child A
  • Right click, visible items-> digital display
  • Right click on the slider -> Advanced -> Customize
  • Right click on the digital display-> Replace -> a Slider (child B)

Now you have three sliders which always will be linked without any extra code.

Ton

Ton
In the first option you've described, is there any good reason to use the property node to write to the child sliders rather than just create a local variable?The second option is a neat trick, if permanently linked sliders is what you need.
nekomatic
By using the 'Value (siganalling) property, you will trigger the 'Value Change' event of the child slider.
Ton
A: 

The 'Value(signalling)' property worked great. Thanks for your help!

Dan
Please accept the answer (or write your own if it's missing some items)
Ton