LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Test indicator vanishes every restart... irritating!

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 5
(3,390 Views)

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

Message 2 of 5
(3,377 Views)
Solution
Accepted by topic author ap8888

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.

*************************************************
CLD
*************************************************
Message 3 of 5
(3,369 Views)

That was silly of me. I use that function all the time with numeric indicators, but never thought of text indicators.

 

Thanks, 

Alex

0 Kudos
Message 4 of 5
(3,363 Views)

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

 

  1. right-click the control...data operations...make current value default
  2. select the control(s) and do menu...edit...make selected values the default
  3. select nothing and do menu...edit..make current values default
  4. Create a diagram constant instead of a control, enter the desired value, then right-click, change to control.
  5. etc.
Now you need to resave the VI, to make the new default values stick. 😄

 

 

 

Message 5 of 5
(3,361 Views)