From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Set all Index of arrays to same value in event-structure

Solved!
Go to solution

Hello,

i have a panel with four arrays and i am using an event-structure.

 

Now i want that changing the index of array_1 also changes the index of the other 3 arrays to same index.

 

But there is only a property "value change" and no property "index-change" in the properties of the array.

So i have to read the property "index" and write it to the other array.

 

But: It seems as if i have to do this in the timeout-section of the event-structure.

Is there any other way to do this?

 

Thanks for help

0 Kudos
Message 1 of 11
(3,489 Views)

This misses if the index is typed in, but you can address that as well.

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 11
(3,482 Views)
Solution
Accepted by OnlyOne

You can use the mouse up event on each array to detec the event (of course that will catch not only an index change, but i don't think you care too much) and then use the "index values" property on all array to set.

 

See attached VI (LV2012), hope this helps

 

 


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 3 of 11
(3,473 Views)

or you can use a seperate control for setting index values and register event on that control.

Message 4 of 11
(3,455 Views)

I also thought about this, but i need to use the scrollbars of my 2D-array.

This works very good with the Mouse-Up event

0 Kudos
Message 5 of 11
(3,440 Views)

for scrollbars also you can use property node.

When index value is greater than 0 then only show scrollbars.

Message 6 of 11
(3,430 Views)

You might want to vote for this idea. 😄

 

Are these arrays controls or indicators? Are all of the same type?

 

If they are just indicators, I would eliminate them and replace them with a table (or possibly 2D array). This way they always scroll together automatically. If they are controls and of the same datatype, you could use 2D arrays.

 

Using 2D data structures instead will also often simplify the diagram. You can always slice out columns as needed on the code side. The UI does not  need to care about that.

Message 7 of 11
(3,419 Views)

You can also combine the 4 arrays into 1 array of clusters and it'll be synchronized automatically.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 8 of 11
(3,413 Views)

The arrays are indicators and all are already 2D-arrays.

I voted for the idea.

0 Kudos
Message 9 of 11
(3,394 Views)

@OnlyOne wrote:

The arrays are indicators and all are already 2D-arrays..


You can still combine them into a table or larger 2D array that contains all data.

0 Kudos
Message 10 of 11
(3,377 Views)