LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Populating Large Clusters

So this isn't really something I'm stuck on exactly, but it's something that I have encountered before, and I was wondering if any of you had found some easier way to do it.

I have a configuration file which contains about fifty or so entries that I use in my program.  I read the key values using the "Read Configuration File" function in a For Loop, and an array of strings that has all of the key names.  I now have an array which contains all of my key values, all of which need to go into a global cluster.  I'm sure most of you have come across this before, so I don't think I need to post the code.  Anyway, my question is, is there an easy way to get the values from the array, or out of the file, and into the cluster?  In the past I have indexed all the elements out of the array, or used the array to cluster function (which ends up being effective the same as indexing), or wired the array into a loop which contained a case structure where each case corresponded to a different "Bundle By Name" element in the cluster.  All of these methods work alright, but they are all tedious to code, and I always end up making mistakes, either wiring the wrong value into some cluster element (which can be hard to debug), or a type-o in the original array, or indexing incorrectly.  Also, this design can be difficult to maintain, if down the road I have to add, or remove items.  Does anyone have a better way of retrieving large amounts of data from a configuration file, and filling a cluster?  I haven't been able to figure one out, and I'm not happy with the methods I have discovered.

Thanks,
Jo-Jo
0 Kudos
Message 1 of 3
(2,646 Views)
If the "array to cluster" function worked, your cluster contains all the same datatypes. Right? What is the data type of the "key values"?
 
Yes, I am sure there are many very easy ways to do this. Could you attach a simple VI that contains typical array data and a typical cluster so we can give a more specific sugggestion?
0 Kudos
Message 2 of 3
(2,641 Views)
Get the variant configuration VIs from the OpenG site. They can save and load arbitrary clusters to config files.

___________________
Try to take over the world!
0 Kudos
Message 3 of 3
(2,629 Views)