tags:

views:

470

answers:

5

Is there a way to link two indicators on a LabView front panel, so that they always have the same value? Right now I'm setting both to the same value every time, but it'd be much easier if there were a way to set up one to mirror the other.

+1  A: 

Strictly speaking, no, you can't do that automatically. What you can do is set up an Event Structure and use the Value Changed events for each of the two controls to update the other. Just realize that the slider fires value changed events many times while the user is sliding it around, rather than just one event at the end. That may be what you want in this situation, however.

eaolson
+4  A: 

You can make the digital display visible. Right-click on the slider and select "Digital Display" from Visible Items.

+2  A: 

There are a few ways to achieve this, depending on how you are trying to display the data.

If you are just trying to update a slider and make a textbox indicator display the numeric value then by right clicking on the slider and selecting 'Visiable Items -> Digital Display' you will have a numeric indicator showing the value of the slider. This can then be repositioned as required. You should see if this meets your requirements as other methods will add complexity to your Block Diagram.

An alternate method would be using a network shared variable and binding the data although I think from your question this would be over kill.

You can also create an event structure to look for a value change event for the slider and update the text indicator accordingly. You would have to be careful how you update the slider as just wiring a value to the slider will not trigger an event for use a property node linked to the slider for the property 'value(signalling)'. Again this may be over the top for your application.

Swinders
Using an event 'Value change' on a slider will cause a lot of events.See here (http://tinyurl.com/cldoex) with some design patterns for dealing with this.
Ton
Swinders
Yes a slider control will generate 'value change' events when the user moves the slider. The important word here is 'control'. When used as an indicator to display a value writing a value does not trigger an event unless you use the 'value(signaling)' property. Just my interpretation of the question
Swinders
A: 

I think this is not easily done, however there are some possibilities (as discussed). The general question is why? You have an indicator with the same info at two places. (or are they actual controls?) If you have two indicators, just place there terminals next to each other, just remember when you alter one of the two (via a local or by ref) to mimic the action for it's twin.

Using a value change event for both controls should work, just remember that you might get race conditions if you don't process the event directly.

Could describe a little bit further why you need two controls for the same action/value?

Ton

Ton
I just wanted two indicators, a slider and a textbox. Visible Items > Digital Display was exactly what I needed.
Ben Alpert
A: 

Is there a way to have one slider affect the output/display of another slider? That is, having two controls but the output and display of one control can be affected by the other.

For example, there are two sliders that adjust two parameters. I would like to be able to adjust the parameters independently but also with a separate slider that could adjust both of those sliders simultaneously and the change would be reflected in those individual sliders.

dan
You should probably ask your own question instead of adding an "answer" to mine.
Ben Alpert