LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

changing array selected index on the fly

I want to change values in my program as soon as an array index is changed.
 
My program runs a test for several parts.  Each part has specific settings.  I want to load those settings for the part as soon as someone selects this part in the array.  In C++, for example, there is a selected index method that changes the value as soon as the index is changed.  Can this be done in LabVIEW?  Maybe even with a Text Ring, Combo Box or Listbox?
 
Thank you for your help in advance.
Ron Deavers, CLD
0 Kudos
Message 1 of 3
(3,149 Views)

There are various ways to do what you're proposing. For example, if "selecting a part" means, say, flipping a switch in an array of clusters, where the switch is one cluster element and the rest of the cluster contains data fields (settings or whatever) for the indexed part, you can use an event structure with a Value Change event. In the handler, compare NewVal against OldVal to see what switch was flipped, then use the array index of the flipped switch to determine the part from which to load the data. Or else you could have some kind of polling structure that looks at properties of whatever front-panel object enables user selections, and takes action when selections change. It's hard to suggest a specific strategy without knowing more about the application.

::Marty

0 Kudos
Message 2 of 3
(3,140 Views)
You can read the index value of an array control using IndexVals property. Here's an example. I think this might be what you meant.
Message 3 of 3
(3,132 Views)