LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to index through a cluster to get label names

Hello, I am trying to make a subVI that extracts parameters from a config file. I am getting stuck at the point where I am trying to save all the data into a cluster. I want to use a cluster because I have all sorts of data in my config file (ints, floats, strings, etc). I want to reduce the amount of code duplication and make the subVI easier to add parameters too. So Im looking to index through a cluster one control at a time and get the control label. Then with each label, I want to use the config VI's to load that specific key from the ASCII config file and save it to the corresponding control in the cluster. The cluster is a strict TypeDef defined in its own custom control. So my questions are:
1) Is there a way to index through a cluster one control at a time and save data to it.
2) Can it be done with minimal use of the property node. In some cases, there may be upwards of 100 parameters in my config file.
0 Kudos
Message 1 of 3
(2,802 Views)
It's not clear from your message whether the cluster also has "upwards of 100 parameters". It's also not clear if you're dealing with complex datatypes like arrays in your cluster. However, in general, you need to access the "Controls" property of the cluster to access the individual controls, and then you can access the labels if that's what you're using as your key. I'm assuming you have something that returns the value from your configuration file based on the label name, so you can update your cluster that way. Something like this:


Message Edited by smercurio_fc on 10-31-2006 09:44 AM

0 Kudos
Message 2 of 3
(2,789 Views)

Go to the OpenG web site and download their file package. It includes the variant configuration VIs which allow you to save and load clusters to INI files.


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