LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save all control value in a file?

Dear Sir,

I want to save all control value in a file, what can I do?
I have already used the 'write key.vi' and ' read key .vi' built in function, but I don't know how
to save the key in a file.

For example, I want to save my control value to C:\Documents and Settings\Administrator\Desktop\New Folder
in file format. It means I can save the different groups of control value in diferent files
(such as group 1, group 2, group 3.....). Therefore, I can select any groups of control value in the path I mentioned above to restore all the values I needed. But I don't know how to do this!!??

Best Regards,
King
0 Kudos
Message 1 of 7
(4,962 Views)
Hello,

If I understood correctly, you want to save the values of your controls to a file to be able to get those values again in the future.
In my opinion, the best think to do in this case is using the XML functions (Advanced -- Data manipulation -- XML.
You can bundle all your controls in a cluster, then use Flatten to XML and then Write to XML file.
To get them back, use Read From XML File, then index the first element of the array, and use Unflatten from XML.

Hope this helps,
Paulo
Message 2 of 7
(4,953 Views)
Hi,
You can make use of the property nodes of that particular VI as shown in attached fig for doing this.
cheers
vicky
Message 3 of 7
(4,949 Views)
Hi,
Else even better way is make use of this property as shown in attached image.
cheers
vicky
Message 4 of 7
(4,945 Views)
Hi Paulo,

Thank you for your help! I could make the XML file and I can
see the script in this file is what I wanted to get. However, I
can't read the the XML. The error message shows that
the 'type' input is mismatch. I don't know how to define the
type of 'Unflatten from XML' function, would you mind giving
me some information in details? Thanks a lot!!

P.S.: The data write to XML is 'Cluster' type.
0 Kudos
Message 5 of 7
(4,892 Views)
Hello Vicky,

I still haven't tried your method yet because of no time.
However, thanks for your help!

BGR,
King
0 Kudos
Message 6 of 7
(4,883 Views)
Hi,

Check annex vi.

Hope it helps,
Paulo
0 Kudos
Message 7 of 7
(4,869 Views)