LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

About Array Click Event

Solved!
Go to solution

Can I click Array to get the data and index of that location?

I uploaded a picture!

0 Kudos
Message 1 of 9
(3,123 Views)
Solution
Accepted by topic author adavb

Yes, but not easily.

 

You have the coordinates of the button click at the left edge of the Event Structure there. Together with a collection of Property Nodes to get the position of the array, the width and height of the elements, and some knowledge of the spacing (depends, if I recall correctly, on the indicator type (Modern, System, etc)) you can calculate the element index.

 

From the index, you only need Index Array to get the data value (you can get the array value from the Ctrl Ref if that pink wire to the left is not the current data values).

 

Edit: Actually, if the array is selectable, then the Array Element > Value property node will give you the value of the element. In that case, the Index is more difficult to find, but do you need that (or only to get the value?)

This would work with Strings too (change the Variant to Data type) but DBLs are easier to generate for testingThis would work with Strings too (change the Variant to Data type) but DBLs are easier to generate for testing

 

IndexVals is read here because I suspect that might also be relevant to getting the index of the selected element (since the click is relative to the visible elements, not the 0,0 element (imagine you already scrolled down the array etc).


GCentral
0 Kudos
Message 2 of 9
(3,111 Views)
Message 3 of 9
(3,104 Views)

Thanks ! 

I solved this problem with your help

You r my Hero!!

감사합니다!!

0 Kudos
Message 4 of 9
(3,034 Views)

Since you are using strings consider using a table instead of an array.

 

A table has a method "Point to Row Column" that will return the index as well as a Boolean if the click was in the bounds of the table.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 5 of 9
(3,025 Views)

Hi guys..

 

1.I want to get Row's values in a two-dimensional array when clicked.
What kind of ways are there?

2. Is there a way to get an Index of the click of a two-dimensional array?

 

plz help me

0 Kudos
Message 6 of 9
(3,012 Views)

Hi adavb,

 

I have a problem …

We have a problem when you create new threads for the same (old) topic…

 

What's wrong with the suggestions you already got?

And why don't you use AutoCleanup before posting code images?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 9
(2,994 Views)

I didn't understand what you were saying.
What does Old Topic mean?

0 Kudos
Message 8 of 9
(2,984 Views)

On August 19, you created a topic called "About Array Click Event".  That is the "old" topic.

Because on August 26, today, you created a new topic called "I have a problem aboud (sic) Array get rows" although it was about the same question.

 

Someone merged the two threads into one.

 

0 Kudos
Message 9 of 9
(2,969 Views)