LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

common indexer for a number of arrays

Solved!
Go to solution

Hello All

Can anybody tell me how to set up a number of arrays (string and number inputs) which uses the index control of one of the arrays to rollover all the other arrays

 

Thanks for your help guys

0 Kudos
Message 1 of 7
(3,090 Views)
Solution
Accepted by topic author rayclout

Create "Index Values" write property nodes for each of the arrays, and have them all wired to a common control. Note that the "IndexVals" property nodes are array... this is because generically, an array has 'n' dimensions and therefore 'n' index values. Since you are interested in only a 1D array, there is only 1 element needed for the IndexVals property.

 

18255iC6310C993A2BBC99

 

Message 2 of 7
(3,088 Views)

Thanks Jack

 

I'm having trouble creating the property nodes you suggested.......can you give me a hint

 

Ray

0 Kudos
Message 3 of 7
(3,080 Views)

Right click on the array to bring up the Context Menu. Then, "Create >> Property Node >> Index Values"

Message 4 of 7
(3,070 Views)

Thanks again Jack

I'm going to give that the "big thumbs up".

I was using the steps you mentioned, but when you right click on the wrong part of the array, it doesn't show the "index values" selection........my bad!!

0 Kudos
Message 5 of 7
(3,067 Views)

OK, let's backup for a second. Things would be much simpler if you would use more appropriate data structures!!!!

 

If the arrays indices need to be synchronized, I would assume that all arrays must have the same length.

 

One solution (similar to Jack's above) would be to only show one of the indices, so only that one can be operated and drag the other, hidden one along programmatically using property nodes. (See attached example on the left)

 

Still.....Why do all that song and dance with (unneeded) property nodes and things only work as expected at run time? Wouldn't it be more reasonable to change to a different data structure? Why not convert it to an array of clusters, each cluster containing the two elements. Now there is naturally only one index and the two visible elements are always perfectly matched, even at edit time!

(See attached example on the right).

 

It would be trivial to convert between the two data structures if needed by the rest of the program. Try it!

 

 

0 Kudos
Message 6 of 7
(3,051 Views)

I agree with altenbach. If you're able to change the data structure, it's always good to get rid of a polling property node. Also, the user interface is typically cleaner and more coherent. Also, keep in mind that once you do this, you can expand the array to show, say, 5 or 10 elements, then right-click on the border of the array and select "Visible Items >> Vertical Scrollbar"

 

18275iFDB362E5F7EF8086

0 Kudos
Message 7 of 7
(3,010 Views)