02-07-2011 02:49 PM
I have a large program with a lot of text indicators. But everytime the VI is restarted (closed and opened), the contents of the indicators vanishes!
What gives?
I've attached an example. Open the file, type something into the textbox, and close the file. Reopen the file and the text is gone.
This doesn't change if the indicator is changed to a control.
Solved! Go to Solution.
02-07-2011 03:05 PM
Closing and opening your VI is not the same as restarting.
The VI maintains a default value for all controls and indicators that it saves to the file. When you close and reopen, you are reopening (restarting means pressing the run button) the file and the default value is reread. If you want to save a new default value for the indicator, go to Edit/ Make Current Values Default, and save the VI.
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
02-07-2011 03:13 PM
You can right click on the indicator then select Data Operations->Make current value default. Save the VI, close and when you open the text will still be there. As you mention you have a lot of indicators, it would make more sense to set the default value pragmatically. There is a method Default Values: Make Current Default but it works only in edit mode not Run mode
http://zone.ni.com/reference/en-XX/help/371361E-01/lvhowto/configcontrolsandindicator/
Another approach can be is to save these values in a file [INI] and then load the file. I prefer this approach. And yet another approach can be to initialize each indicator at the beginning of the VI.
02-07-2011 03:15 PM
That was silly of me. I use that function all the time with numeric indicators, but never thought of text indicators.
Thanks,
Alex
02-07-2011 03:23 PM
As Ravens already pointed out, unless yo specify differently, controls and indicators are saved with their default values. This is a good choice! Imagine you have a graph displaying hundreds of megabytes of data. Would you really want to inflate your saved VI by that much?? Would you really want the VI marked as dirty every time you run it with different values? Thought so. 🙂
You can do any of the following