05-12-2009 07:17 AM
Can someone provide me any VI example that ables
the user so save his choices front the front-panel? And tell me if it is possible to save the values and
strings from all fields that have been filled by the user. I want to implent a "LOAD" and "SAVE"
parameters, and i want that those parameters can be read outside LabView, in order to ease up user's intereaction.
It would be wonderful if someone can support me in that.
Many thanks,
TN
Solved! Go to Solution.
05-12-2009 07:26 AM
05-12-2009 07:45 AM
Hi Mathan, thanks for the reply, but what you send me it's to save the FP to a .jpeg file. And that's not what i am looking for. I want to save the user's choices, which are numeric and strings, to a file that later can be open again by Labview. I want to implement a save setup and load setup, with the options the user has made. To able the user to repeat his experiment without filling all the fields over and over again. If you need, i can attach my VI, to see what kind of info i want to save and load.
Thanks
TN
05-12-2009 07:48 AM
TN,
Look at the configuration file functions. You should be able to do what you want with those.
Lynn
05-12-2009 07:48 AM - edited 05-12-2009 07:49 AM
HI
This is usually done by using property nodes to get the control params/wire values and saving them to some file. You usually have to make your own filetype (.ini?) etc but what may be particularly usefull is the "flatten to xml" function under the file I/O pallete.
Craig
05-12-2009 07:52 AM
Hi Lynn, thanks for the reply.
I've been already looking to that, VI's config files, etc. But, i'm new with it, so if you can send me a little example, i would be very grateful.
TN
05-12-2009 07:57 AM
Hi Craig, thanks for the reply,
Can you send me pls a little example?
Thanks
TN
05-12-2009 08:04 AM
TN,
I do not have any examples readily available. Decide what needs to be saved. When the user presses the Save button, read all those controls and write to the files. If each control has a unique label, you can use the labels as the key names for the config files. When the user presses the Load button, read the config file and write the data to the controls using local variables (this is one of the legitimate sues for locals) or Value property nodes.
If you have lots of controls, you can programmatically match key names with control labels and write the data with property nodes in for loops without needing to create a local or property node for each control. Start with a reference to the panel and get the array of control references Controls[ ], then loop through that array.
Be aware that the config files are set up for simple datatype controls. Dealing with arrays and clusters is more complicated.
There can be a bit of a learning curve working with the config file VIs. I suggest you make some small test VIs while you are learning.
Lynn
05-12-2009 08:09 AM
Lynn,
I'm attaching my VI. Can you pls take a quick look at it and tell me what's the best way for me to do it?
Thanks
TN
05-12-2009 08:32 AM
Hi
I have attached a very quick and dirty example. But you should get the idea behind how to do this 🙂
Craig