LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Keeping the data I enter in my VI after I close the V, without it resetting to default?

Solved!
Go to solution

My VI allows the user to enter a song using the amplitude, duration, and frequency of each note that is stored in an array.  When the VI runs, the inputed notes are played to allow user to hear the song. I would like the input to remain in the arrays after the VI closes.  Currently, when the VI closes, the values are reset to the default.

0 Kudos
Message 1 of 11
(6,468 Views)

Is this a VI being run within the development environment and re-opened before closing LabVIEW? If the VI is re-opened before exiting the application, the previous control and indicator values should be saved unless they are programmatically reset. If this is the case then, look for a Reinitialize to Default Value invoke node in the code.

 

If you are closing and opening the application, then there is no way for the application itself to keep track of the values. To re-load the values next time you open the application you'll need to save them to file when closing the file and open the file again when the VI starts. LabVIEW supplies really handy Config VIs to save and load values from file. You should also look in to the OpenG add-on. They supply VIs called Write Panel to INI and Read Panel from INI that can quickly be added to your code to save and load the front panel controls and indicators.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 2 of 11
(6,461 Views)

Use Write to spreadsheet file when exiting and Read from spreadsheet file when starting to store and retrieve data in this way.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 11
(6,408 Views)

Check out OpenG.  In their Variant Configuration palette there is a single VI that will save all control values to an INI file.  They then have a single VI that will take an INI file and load it, setting all the control values of your VI.  Read Panel from INI, or Write Panel to INI.  It is on the slow side if you have lots of data but it doesn't get much simpler than that.

0 Kudos
Message 4 of 11
(6,378 Views)

Smiley Very Happy

Sometimes I don't think you guys read my replies.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 5 of 11
(6,370 Views)

Oh geez sorry.  Yeah sometimes I skim.  Dispite my activity level I don't have unlimited time to post on the forums, so some times I take the low hanging fruit, and skim.  Maybe it's not about the posts in your kudos, but the kudos in your post?  That doesn't quite work but you know what I mean.  You get a kudo for calling me out.

0 Kudos
Message 6 of 11
(6,351 Views)

Heh, no worries. crossrulz does the same thing all the time and gets the marked solution because he was straight to the point, so maybe I should try simpler answers. The result is more feedback for OP and that's what matters at the end of the day. 

👍

 

 

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 7 of 11
(6,342 Views)
Solution
Accepted by Dr_Dean

@James.M wrote:

Smiley Very Happy

Sometimes I don't think you guys read my replies.


Argument from popularity. If several gives the same tips/solutions it must be a good one. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 11
(6,292 Views)

Yamaeda wrote:

Argument from popularity. If several gives the same tips/solutions it must be a good one.


Eh I guess that's what kudos are supposed to be for.  If an answer is exactly what I was going to say I'll kudo it.  If the answer is what I was going to say, but I can think of another method that might work for OP I'll post the alternate solution.

0 Kudos
Message 9 of 11
(6,218 Views)
Solution
Accepted by Dr_Dean

Clicking Save current values to default works.

Message 10 of 11
(6,183 Views)