01-30-2016 01:27 AM
Hello,
I have seemed to run into a road block with how to convert binary values into ascii.
I created this .vi to save all control values into an .ini file and call them back when I am executing the .vi as shown in the attached file. The save button will simply save the data and cancel button will ignore all the current changes.
I would like to understand how to retrieve all the control values in ascii format, so I assign them into a global variable for later usage. I have been looking everywhere for a good reference document and I couldn't find one which would explain my question. I would be greatly appreciated if someone could point me in the right direction.
Thanks
Sam
Solved! Go to Solution.
01-30-2016 02:02 AM - edited 01-30-2016 02:05 AM
I think you picked some pretty old and way over too complex example. This is just much easier. Did you search in the forum and elsewhere how to properly use configuration files? This is one of the 10 most often asked questions in the forum. There is waste of examples in the forum and other places how to properly do it.
Sam_Sharp here gives some good ideas how to do it using the openG toolkit:
01-30-2016 03:08 AM
Thanks for giving me a different prespective on how to slove my issue. I have been seeking a simple way to save control values in the front panel for while now and you have shown me different method. In my main application, there are muliple VIs that I need to commence this process.
For my initial issue, I think I figured out the solution after trying out different things. I used the "Flattened String To Variant Function" to slove my issue.
Thanks
Sam
01-30-2016 04:07 AM - edited 01-30-2016 04:12 AM
I have been seeking a simple way to save control values in the front panel
Do not reinvent the wheel, when there are ready to use solutions, for example:
http://sine.ni.com/nips/cds/view/p/lang/en/nid/209753
Use the MGI Save & Restore Settings VI from the palette (for example it saves all settings modified in a Graph, very useful), and the MGI Save (Restore) Front Panel Data VIs (to save and restore control values in the Front Panel).
Here is an example:
01-30-2016 04:30 AM
Awesome. Thanks for your guidance. Most importantly, I will utilize your method by using the MGI library in my application.
I just wanted to let you know that I did use the OpenG library and was able to reduce the complexity of my VI tremendously.
01-30-2016 04:33 AM
07-23-2018 06:09 AM
Hello,
It's really helpful.
But there is another quention, how to save the front panel values and restore it on different VIs?
For example, the main VI use some confire values like hardware port, report path and so on, when we want to change it, we will use Menu bar--Config event and user interface to reconfirge them, and then save it. After restart the main vi.exe, it should restore the values that confired at last time, not press Menu bar--Config- restore event.
How to realize it?
Thanks.
07-23-2018 06:32 AM
@Will_Yuan wrote:
Hello,
It's really helpful.
But there is another quention, how to save the front panel values and restore it on different VIs?
For example, the main VI use some confire values like hardware port, report path and so on, when we want to change it, we will use Menu bar--Config event and user interface to reconfirge them, and then save it. After restart the main vi.exe, it should restore the values that confired at last time, not press Menu bar--Config- restore event.
How to realize it?
Thanks.
I do not understand what is the question actually. You should just program easily what you described. Like you can programmatically save/restore settings using the Event structure...
07-23-2018 06:33 AM
@Will_Yuan wrote:
After restart the main vi.exe, it should restore the values that confired at last time
Just do the load settings as part of the VI's initialization.
07-23-2018 08:44 PM
Yes, you are right.
I made a logic mistake.
The "save and restore front values functioning" should in the Main Vi, not in the "Configure user interface vi".
It works now.
Thanks.