11-23-2021 01:21 PM
I have a large program with many tabs and buttons and textboxes/arrays. Currently I read and write to an Excel file. It seems to me that if I can save everything as default, I should also be able to save to different files. This would save a lot of code and be more scalable, I think.
11-23-2021 03:08 PM
Your explanation is vague and does not clearly explain what your ask is.
Please rephrase your query and provide all supporting details.
11-23-2021 03:47 PM
11-23-2021 05:32 PM
So, you would like to read the last values of the controls in your VI to a file when the execution ends.
Now, instead of writing all control values to the same file, you want to write the values to different files based on the tab that control resides in - is that correct?
I believe there is no existing easy way that LV provides for you to do that, of course, you can implement it the way you like to store a different set of control values to different files.
11-23-2021 08:39 PM - edited 11-23-2021 08:42 PM
There is a shipping example that statically saves your front panel objects' value to file. Study it and you can probably figure out how to modify it to select the file for saving and restoring.
11-24-2021 08:07 AM - edited 11-24-2021 08:18 AM
So, you would like to read the last values of the controls in your VI to a file when the execution ends.
YES
Now, instead of writing all control values to the same file, you want to write the values to different files based on the tab that control resides in - is that correct?
NO
I want to save the current condition of the front panel and give it a filename. Just like under the Edit menu "Make current values default but have a folder with different default values to choose from.
I currently save all these things individually and the save function is bloated with arrays and textboxes/dropdowns, and it's difficult to expand it because if I add something I have to change my spreadsheet that I read and write the values to. I have to add the new controls to the read and write section and it's just painful.
11-24-2021 01:02 PM
@RHutchings wrote:
So, you would like to read the last values of the controls in your VI to a file when the execution ends.
YES
I want to save the current condition of the front panel and give it a filename. Just like under the Edit menu "Make current values default but have a folder with different default values to choose from.
I currently save all these things individually and the save function is bloated with arrays and textboxes/dropdowns, and it's difficult to expand it because if I add something I have to change my spreadsheet that I read and write the values to. I have to add the new controls to the read and write section and it's just painful.
If you do NOT need to use an Excel sheet then the following may work for you with minimal coding:
11-24-2021 01:15 PM
Another even easier option.
Download OpenG Tools from VIPM.
There is a Write Panel to INI tool that will write all the values of the front panel to an INI file. See below.
The file contents look like this
[Untitled 3]
Tab Control = "Page 1"
Array = "<size(s)=3> 1.000000 2.000000 3.000000"
String = "My Value"
Numeric = "2.000000"
Boolean = "FALSE"
Path (dialog) = "/C/Users/XXXX/TestRWAnythinTab.txt"
configuration file path = "/C/Users/XXXX/TestRWAnythinTab.ini"
11-24-2021 02:45 PM
Thank you all. I'll give these a try after the holiday on Monday.