06-02-2009 03:51 PM
06-02-2009 03:57 PM - edited 06-02-2009 03:58 PM
Hi Philip
Check out the config file vi's on the file and dialog pallet. Plenty of examples exist and I use them all the time.
a config file has the following (generic) format
[Section0]
Key0=Value
Key1=Value
[Section1]
Key0=value.... etc
Where Section names and keys are Strings and Values are litterals of any scalar type
06-02-2009 03:57 PM - edited 06-02-2009 03:58 PM
Functions on File I/O > Configuration File VI's palette will let you create and read exactly the kind of file you are looking for.
Missed it by that much!
06-03-2009 09:36 AM
Jeff and Wayne, thanks for the help.
However, as Jeff pointed out, these functions only accept scalars. So wiring a cluster to one of these blocks is not possible. See attached. I'm looking to create a config file for cluster values. Not sure this is possible now without using Flatten to XML function.
06-03-2009 09:58 AM
I have done this before.
06-03-2009 10:24 AM
06-03-2009 10:47 AM - edited 06-03-2009 10:49 AM
Hi Philip,
This Nugget on using control references to save and restore cluster contents is one solution. It uses the clusters data structure to generate the Key Names for the ini file. here is a preview
please note: That example uses an array of clusters because getting at cluster elements within an array is not easy. if you are not using arrays, it should still owrk provided you either use the data types I supported or are willing to add support for any that I left out.
Ben
06-03-2009 11:00 AM
Ben,
Thanks for the detailed response... as always.
The Nugget looks very useful. I'll have to read through it later to figure it out.
Phil
06-03-2009 11:05 AM
There's a VI in OpenG that saves clusters directly to a config file.
I think it uses the format
[cluster name]
first item=value
second item=value
etc.
Of course there's also one for reading the cluster. It makes life very easy.
06-03-2009 11:21 AM - edited 06-03-2009 11:21 AM