LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use another control to change the index of a array

Solved!
Go to solution

Hello 

 

I want to use another control to change the index of a array on the front panel. It must be possible right? I can not find it though. Can someone tell me how to do this ?

 

thank you for the help !

0 Kudos
Message 1 of 19
(2,061 Views)

Can you elaborate a little more? What do you mean by another control? What was the previous control that you used? 

0 Kudos
Message 2 of 19
(2,046 Views)

thank you for your reply !

 

I would like the master control to be able to change the index of the slave array.

 

 

 

Its_Me_0-1688151473829.png

 

0 Kudos
Message 3 of 19
(2,039 Views)

Can you show a picture of your block diagram? But attaching your code would be better. 

I think I kind of know what you mean. See attached code. Is it similar to what you are talking about?

0 Kudos
Message 4 of 19
(2,011 Views)

There is hardly anything in the code it is just a master control the number there is now 0 when I change the master control to 1 I want the index from the slave also to change to 1 etc. 

 

So if the data in the array is 1 2 3

and master is 0 then the index should also be 0  

 

Its_Me_0-1688154140075.png

 

 

the index is indicated with a red arrow. When I change the master to 1 the index should also change to 1

 

Its_Me_1-1688154214647.png

 

I can am not able to connect the master control to the index, also not with the property node.

0 Kudos
Message 5 of 19
(1,998 Views)

I modified. Try the attached code. Is this what you are trying to achieve?

0 Kudos
Message 6 of 19
(1,982 Views)

Yes that is what I was searching for, the thing is, I was searching for the property node of the index of the array but it seems there is none ? I think this will work though.

 

 

 

Its_Me_0-1688156563608.png

thank you !

 

the reason why I needed is a little bit more complicated but I am too tired so I will explain it another time. Thanx for the help

 

 

 

0 Kudos
Message 7 of 19
(1,964 Views)
Solution
Accepted by altenbach

Create a property node for the array.

Pick the "Index Values" property.

Wire your Master control to this property with a Build Array on the wire. 

aputman_0-1688157933241.png

What this property does is set the top left position of the array as the row (column, page) you specify.  If your array is multi-dimensional, you will need one value for each dimension.

aputman
Message 8 of 19
(1,945 Views)

@its_me I would highly recommend to do as aputman showed.

0 Kudos
Message 9 of 19
(1,932 Views)

Typically, changing the index is confusing to the user but some use it to display exactly one element of an array. In that case, you could equally well just index out that one element.

If you show multiple elements and scroll around with the index, I recommend to also show the scrollbar.

 

Yes, the indexvals property is the correct way to do this. Here's a quick rewrite:

 

altenbach_0-1688159554260.png

 

You probably want to hide the index terminal in this case, else you need to deal with the case where the user tries to change it.

0 Kudos
Message 10 of 19
(1,924 Views)