LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically link my VI to a configuration file

Tried a search but got very confused with some of the answers. Ring menus, global variables,...I'm lost!
 
Goal: Build a generic VI that can load a file containing information about different parameters to test a piece of equipment. I would have a file for every model.
 
Question: Is there an easy way to extract parameters from files that are not the same length? Is there a way that these parameters become objects in combo boxes?
 
Thanks!
0 Kudos
Message 1 of 10
(4,008 Views)
I suggest you take a look a OpenG configuration file VIs.  You can install this package with the VI Package Manager.  In these tool, you have a "Write INI Cluster" and "Read INI Cluster" VIs that allow you to easily write clusters of different data types to an INI file and then retreive them in the same format.  You could write a generic VI that uses these tools to write or read your instrument parameters bundle into a cluster.  All you would need to do is have a control to specify the exact definition of the differents clusters (equipment models) you would write/read from the file.
Good luck!

Yohan

Message Edited by NahoY on 10-12-2006 10:39 AM

Message 2 of 10
(3,997 Views)
Sure. One way would be to use the Get Section Names. This returns an array of strings. Wire the array to a for loop that does a Get Key Names which also returns an array. Wire this array to another for loop that has a Read Key. A list or combo box has a property called Strings [ ]. This is a 1D string array that you would wire from the results.
Message 3 of 10
(3,988 Views)

Thank you so much for your answer. I can do so much more now. I have written all my config files, and can update combo boxes using StringsAndValues[]. But since I have more than 20 combo boxes, is there a way to update them all in a FOR loop?

Each section in my config file corresponds to a single combo box. I'm pretty sure I could do what I want if I could edit the name of the combo box that I want to modify. I looked in the property node options but did not find anything.

Also, when I update my combobox with the same information as what was previously in it, I get the following error, "You cannot assign the same value to two or more strings in a ring or combo box control". I tried using the re-initialize method without any success. My current way of doing it is read StringsAndValues[], keep the first one (which is empty) and re-write StringsAndValues[] to 're-initialize' it . I can then fill the box with whatever I want. I am sure there is a much easier way to do this.

Thanks

0 Kudos
Message 4 of 10
(3,963 Views)

I had another idea. Would it be possible to create combo boxes while my VI is running?

Thanks

0 Kudos
Message 5 of 10
(3,949 Views)

Anybody? Your input means a lot to me!

 

Thanks

0 Kudos
Message 6 of 10
(3,921 Views)

Hi Eudaemonic,

Could you please post your VI so I can see what you have done so far?

 

Kalin T.
0 Kudos
Message 7 of 10
(3,912 Views)

Thank you for your help Kalin,

Here is my test VI for editing comboboxes, along with an example configuration file containing different menu choices. It is very basic as this is a trial and error learning platform.

Thanks again for your input.

Fred

Message Edited by Eudaemonic on 10-17-2006 02:16 PM

Download All
0 Kudos
Message 8 of 10
(3,895 Views)

Fred,

I ran your example but it did not work. It did not populate the comboboxes. Was it working for you?

 

Kalin T.
0 Kudos
Message 9 of 10
(3,869 Views)

Fred,

Make sure you check out the configurations settings example in Example Finder.

C:\Program Files\National Instruments\LabVIEW 8.0\examples\file\config.llb\Read Configuration Settings File.vi

 

Kalin T.
0 Kudos
Message 10 of 10
(3,866 Views)