LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone advise me on how to save and recall the satate information of a cluster of combo boxes?

Solved!
Go to solution

I have a set of combo boxes saving a devices state information. I would like to save and recall all the selections. I know there are properties to access the selected items, but searching about, I'm not sure the technique to do this. I would like to save/recall in XML format. I made an attempt and it saved the combo box data, but not the selections. Thanks for any help.

0 Kudos
Message 1 of 12
(3,660 Views)

Could you provide the missing sub-VI, "XML_FileControl.vi" ? 

 

Thanks,

--
Peter Rifken - Field Engineer & Business Manager
Boston / North New England & Maine
0 Kudos
Message 2 of 12
(3,657 Views)

Sorry. Here it is.

 

0 Kudos
Message 3 of 12
(3,644 Views)

Have you tried using the config file VIs?  It's not xml format but they have been working well for me.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 4 of 12
(3,637 Views)

MoResse I am very familar with the Config file VI's, that or XML file format are not the issue I am trying to solve. I need to get access to the array of selected bools

from the combo state array to read and set before I can save and recall that info. When I went thru the Invoke Property node for any one of the combo boxes

I was only able to access singular values for the selections, not the array of values I need to get access to read from and write to the combo box controls in the

typedef. I have seen where sending a cluster to the XML flatten and the XML write for simple controls in the cluster save the control information and recalls it

and put into the typedef when read back. I am not finding this same behavious with the more complex combo box. It saved the combo box information for the

items in the control, but not the selections chosen at runtime. So what I am trying to do is when the program runs the operator can make a set of selections

and I want to save this, so the next time they run, the operator does not have to reselect all the choices again.

0 Kudos
Message 5 of 12
(3,625 Views)

I'm not sure what you mean by a bool of array.  There are no booleans in your program from what I can see.  If I understand you correctly, your trying to read the individual elements of your cluster control, is this right?  You can do this using Property nodes.  This is just and example.  Let me know if I'm off base. 

 

Use a For loop to process your elements that you want to save.  I would consider using an Event structure for your main VI.  This will do what you are trying to do here, and it will be more compact, cleaner, and more scalable.

 

Reading elements of cluster.png

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 12
(3,621 Views)

I believe the problem here is a basic misunderstanding of LabVIEW, not a problem with reading and writing the XML file.  When you click "Multistate Recall" or "Single State Recall" the values get loaded properly, but then on the next loop iteration the indicator gets reset with the default values, because they are passed through the False case.  If you use a shift register instead of a tunnel, or you place the indicators inside the case structure, I think you will find that it works.  You may also want to place the controls inside the loop, because right now you'll only write the values that are set when you hit the run button.  If this is not clear, run your code with execution highlighting turned on (the lightbulb icon in the toolbar).

0 Kudos
Message 7 of 12
(3,615 Views)

I think this is not the correct answer, but the right access path to the state (sorry my presumption of boolean) values. I'll explore this more and see if I can get the selected state values stored with the other XML setup state info for the combo box clusters. I'll keep you posted.

0 Kudos
Message 8 of 12
(3,598 Views)

Sorry Nathand, not a solution and it's not a basic misunderstanding, just a refinement of technique on storing a multidimensional that is a multistate set of combo box elements and the user selected state information. I tried your solution and got no change in behavior.

0 Kudos
Message 9 of 12
(3,599 Views)

I found that I was finally able to save the state info. It was a couple of things. Nathand was partially correct on putting the output cluster inside the case so it only set on true. But it still did not save the state information, until I set the selected values as the combo box data defaults. Then it saved and recalled correctly. I would still like to understand the selecion mechanism of the conbobox control to better understand the information/control behind it. I did find the selection array and was able to also count this to multiply with the other parameters to get the count of total permutations for test.

 

my preference would be not to have to set the combo box default data for each control, but have it save the selections active from the input interface.

 

Anyway food for thought. Thanks for you inputs.

0 Kudos
Message 10 of 12
(3,593 Views)