취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

About Array Click Event

해결 완료!
솔루션으로 이동

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

I uploaded a picture!

0 포인트
1/9 메시지
5,178 조회수
솔루션
승인자 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 포인트
2/9 메시지
5,166 조회수
3/9 메시지
5,159 조회수

Thanks ! 

I solved this problem with your help

You r my Hero!!

감사합니다!!

0 포인트
4/9 메시지
5,089 조회수

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
5/9 메시지
5,080 조회수

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 포인트
6/9 메시지
5,067 조회수

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 포인트
7/9 메시지
5,049 조회수

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

0 포인트
8/9 메시지
5,039 조회수

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 포인트
9/9 메시지
5,024 조회수