LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatically initializing a knob

How can I programatically initialize the value of a Knob control? I want
to be able to dismiss a control pannel with knobs but when I bring it back
I want it to retain the last setting.
0 Kudos
Message 1 of 3
(2,760 Views)
"Rob Young" wrote:
>>How can I programatically initialize the value of a Knob control? I want
to be able to dismiss a control pannel with knobs but when I bring it back
I want it to retain the last setting.

One way would be to use a local variable. If it is a sub-vi, pass in the
"old" value and set the knob with a local variable. If it is a top level
VI, read in the value from a file and set it with a local variable. This
would mean that you would have had to written a file at the end of the previous
run.

There are other ways to do this, but this is the simplest.

I hope that this helps,
Bob Young
0 Kudos
Message 2 of 3
(2,760 Views)
Rob Young wrote:
>
> How can I programatically initialize the value of a Knob control? I want
> to be able to dismiss a control pannel with knobs but when I bring it back
> I want it to retain the last setting.


Rob,
you might be able to put the knobs in an un-initialized shift register.
Next time you call the knobs, the shift register value will equal the
last value.

_____________________________
| |
| |
|^|--->Local var Knob ---->|^|
| of knob |
|_____________________________|

You would need to reset all the knobs to zero when you first
start up the program.

Walter
0 Kudos
Message 3 of 3
(2,760 Views)