LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set up dependent defaults?

I am taking my first shot at designing a full-featured GUI. I wish to have a number of primary parameters change the default values for secondary parameters, with the user still being able to directly change these secondary parameters. For exampl, if experiment type A is chosen, time increment should change to 100ms; if experiment type B is chosen, time increment should change to 500ms, but the user still retains control. I am wondering what the best way to do this would be?
0 Kudos
Message 1 of 5
(2,725 Views)
You can set the value initially (ie. before the user can change the increment) using a local variable to the control. See attached example in LV 6.0.

Kim
0 Kudos
Message 2 of 5
(2,725 Views)
I want the user to see the changes in secondary value and then have the freedom to modify the value. That would seem to indicate that I need some sort of loop, where the user changes a primary control and the secondary values are changed via a local variabel to the control. It would seem that event handling would be the best way to do this but I dont have LV6.1. In LV6.0 it appears that I should poll each primamry value and test if has changed, in which case applying the appropriate changes to the other values. Is this the best way to do this in LV6.0?
0 Kudos
Message 3 of 5
(2,725 Views)
Yes, if you really cant set the value initially, then polling the value for a difference is all that i can think of. Appart from having a 'manual' button to press which stops the local variable writing to the control and then the user is free to add whichever value they want. And if they change their mind they can press the 'manual' button again to reset the default value.

Well this is basically what you said, but i think you are on the right track.

Kim
0 Kudos
Message 4 of 5
(2,725 Views)
> I want the user to see the changes in secondary value and then have
> the freedom to modify the value. That would seem to indicate that I
> need some sort of loop, where the user changes a primary control and
> the secondary values are changed via a local variabel to the control.
> It would seem that event handling would be the best way to do this but
> I dont have LV6.1. In LV6.0 it appears that I should poll each
> primamry value and test if has changed, in which case applying the
> appropriate changes to the other values. Is this the best way to do
> this in LV6.0?
>

Yes. Use a shift register to have history to compare against, and you
might also want to bundle your values into a cluster to simplify the
number of things to compare.


Greg McKaskle
0 Kudos
Message 5 of 5
(2,725 Views)