LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I set the default value of knob as the value that was indicated in last run

When I run a program, I want to set the default value of knob as the value that was indicated in last run, how can I do this, thank you.
0 Kudos
Message 1 of 14
(2,112 Views)

Hi ctjh,

do you use the knob in a sub vi? Do you overwrite the default value from outside the sub vi? Can you explain your program a bit more, or upload your vi?

 

Mike

0 Kudos
Message 2 of 14
(2,110 Views)

Hi Mike

    

    Thank you for your response. I use the knob in the main vi, and have none subvi. When I run the program for the first time, the value of the knob may be adjusted. I means when I run the program next time, the knob value I have adjusted was set as the default value. How can I do? thank you.

 

ctjh

0 Kudos
Message 3 of 14
(2,102 Views)

Hi ctjh,

you can use the method "Reinit to default" and place it before your loop (i guess you are using a loop), connect the error cluster to the loop. You can create it with a right click on your knob. Select "create -> invoke node -> reinit to default".

 

Mike

0 Kudos
Message 4 of 14
(2,098 Views)

Hi mike

    

    I am sorry I did not explain my meaning. I don't use loop. I means when I run the program today, I may change the knob value. I hope that the changed knob value was set as the default value. When I run the program maybe tommorrow, the default value of the knob was the the value that was changed in the last run. 

0 Kudos
Message 5 of 14
(2,090 Views)

hi,

can u post ur vi?

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 6 of 14
(2,083 Views)

Hi ctjh,

right click on your knob and select "data operation -> make current value default". Save the vi. If you close the vi and open it again, then the knob should have the default value.

 

Mike

0 Kudos
Message 7 of 14
(2,079 Views)

Every time you run the program the knob will have the default value (unless you set it otherwise). If you want to store the value over several executions of your application, you'll have to save the value somewhere (registry, ini file, any other file) when quitting the application and read it back when starting the application.

 

Message 8 of 14
(2,075 Views)

Hi dan_u,

 

     I think what you said is my hope. But how can I realise it. Is there example in Labview? Or how can I read the save the value and read it in the program?

     Thank you, Mike and Gaurav.

 

ctjh

0 Kudos
Message 9 of 14
(2,071 Views)

Hi ctjh,

you can do it like this.

 

Mike

0 Kudos
Message 10 of 14
(2,065 Views)