From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,591 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,591 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,591 Views)