09-27-2015 10:17 PM
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.
Solved! Go to Solution.
09-27-2015 10:28 PM
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> ---'
09-28-2015 07:31 AM
Use Write to spreadsheet file when exiting and Read from spreadsheet file when starting to store and retrieve data in this way.
/Y
09-28-2015 11:26 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2015 11:40 AM
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> ---'
09-28-2015 12:33 PM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2015 12:41 PM - edited 09-28-2015 12:42 PM
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> ---'
09-29-2015 02:54 AM
@James.M wrote:
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
10-01-2015 08:11 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
10-01-2015 02:44 PM
Clicking Save current values to default works.