08-20-2010 07:52 AM
Trying to shrink some rather large vi diagrams used to read configuration parameters from ini's. No issues putting the key names in an array then using autoindex to pull in the data. My question is after I get the data read into another array how do I get it into a cluster by name? Currently I convert the array to a cluster but the cluster doesn't have any names so I rebundle into my cluster. Seems like I'm doing an extra step that doesn't need to be done.
Opinions / Ideas welcome.
08-20-2010 08:00 AM
If you are able to use the OpenG library (I know in a lot of corporate situations people aren't) they have some tools that allow "ini files" to be created directly from a cluster with suitably named controls, then when read back repopulate a similar control. I had created a method similar to theirs, but it had "special cases" all over, where theirs handles pretty much everything, arrays, enums, etc. Just a thought. Otherwise the brute force method you are doing is about the only way. Of course any changes ...
08-20-2010 09:28 AM - edited 08-20-2010 09:29 AM
If your cluster elements were all of the same datatype then you could just do this:
08-20-2010 09:35 AM
Of course they aren't all the same type; that would be far to simple. I have a little of everything; the snippet was just from one sub-vi. I had the ini loads broken up in sub vi's for each section. I do like that technique and I have added your example to my little stash of hints.
Poking around the OpenG and MGI pallets I think the Read/Write anything will do what I need while allowing simple maintainance. I'm just always a bit concerned about using 3rd party stuff.
08-20-2010 10:33 AM
F1_Fan,
"OpenG Variant Configuration File VIs" is a great set of functions for dealing with ini's. The best part is that it will work with type def'd clusters.
08-21-2010 01:05 PM - edited 08-21-2010 01:07 PM
I highly recommend the OpenG VIs in general and the variant config VIs in particular. They work extremely well.
Here are a couple of less obvious points regarding the two: