LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the control values to stay when you close an VI

HELLO!

I want to make my input values (control values) to stay after you close the VI. So next time you open it up, you will have the same values already stated. Is this possible??

Thanks for your help!!

Best Regards

Krille
0 Kudos
Message 1 of 8
(3,644 Views)
You could go about doing this in two ways.
1.You write all the states in a file and read it before you enter your program.
2.You can make use of the VI property ,"save current states as default " in the end of the program before you exit,so that the next time you come in it will be reflected.
cheers
vicky
Message 2 of 8
(3,631 Views)
Before your test software quit & exit, get all "Controls" values/statuses, either by its properties node or local variable, save them to a file i.e. Configuration File VIs (for instance, status.ini)

The next time you invoke the test software again, open the status.ini file and retrieve all the status and set all the controls.

Hope this is still clear as I am at the Friday evening mood 😛
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 8
(3,626 Views)
Another possibility is to paste an invoke node on your block diagram, select the VI class, select methods Get Control Value or Get All Control Values and save the output to a file before closing the front panel. On front panel open, read back your file and use Set Control Value or Set All Control Values.

Paolo Grignani
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 4 of 8
(3,621 Views)
Hello Vicky!

I like choice no 2. Is is possible somehow to do this in the code? Or must I always do this manually?

BR

Krille
0 Kudos
Message 5 of 8
(3,614 Views)
Just see the attached image it shall help you do it.
cheers
vicky
0 Kudos
Message 6 of 8
(3,609 Views)
Hi, Vicky!

I tried to do like you showed me, but I got problems. I got error code: 1073 occurred at Invoke Node in jula.vi

Possible reasons(s): Labview: This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.

What do you think is the problem??


Thanks for your help!!

BR

Krille
0 Kudos
Message 7 of 8
(3,604 Views)
Krille,

Make Current Values Default writes the necessary data into the VI itself, so the VI must be modifiable.
This is impossible, e.g., when the application is compiled into an exe file.

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 8
(3,601 Views)