LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Property node of a control inside of cluster inside an array

Solved!
Go to solution

@itronChiraldude wrote:

Criticizing is pointless. 


I am criticizing, because You do heavy operations on front panel objects instead of data in wires/memory. Involving the UI tread is an abomination. All the UI thread should do is asynchronously update the front panel from the transfer buffer when the data is written to the terminal.

 

I assume that the attached quick modification is what you are trying to do. I think it would be trivial to Put the 2D array of clusters into a DVR and operate on that using the DVR reference as one of the subVI connectors. Have an independent loop in the toplevel that occasionally reads the DVR and sends it to the terminal. (not shown)

 

2DClusterUpdate.png

Message 11 of 26
(1,387 Views)

@Ben wrote:

@paul.r wrote:

Seems like you want to update individual elements of the array by reference - I could be wrong, but I dont think there is any easy way to do this. Instead of using VI server, why not just modify the data directly, then write to the indicator?


You are correct there is no easy way but it can be done.

 

Key to doing it is to realize the array element in the top left corner is the element that gets the update.

 

Ben


Not quite.  The element that gets the update is the most recent one to have key focus.

"If you weren't supposed to push it, it wouldn't be a button."
Message 12 of 26
(1,378 Views)

@paul_cardinale wrote:

@Ben wrote:

@paul.r wrote:

Seems like you want to update individual elements of the array by reference - I could be wrong, but I dont think there is any easy way to do this. Instead of using VI server, why not just modify the data directly, then write to the indicator?


You are correct there is no easy way but it can be done.

 

Key to doing it is to realize the array element in the top left corner is the element that gets the update.

 

Ben


Not quite.  The element that gets the update is the most recent one to have key focus.


That may be part of what was escaping back when I was working it out. I did resort to setting only one element visible and using the indexes to set which element I wanted to target but in that case, I may have been indirectly setting the key focus.

 

Thank you!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 13 of 26
(1,371 Views)
Solution
Accepted by itronChiraldude

Maybe something like this will get you going.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 14 of 26
(1,369 Views)

Looks like key focus is the issue.  Everything I read points to the element being accessed by ArrElem as the one in the upper left corner but I guess the fine print is that this only fully applies if the array is reduced to having only one element visible. The IndexVals property actually behaves as though the last key focus location is 0,0

0 Kudos
Message 15 of 26
(1,360 Views)

Either way, I think the better solution is maintaining the data and updating the control directly - Altenbach's solution is exactly what I was getting at. 

0 Kudos
Message 16 of 26
(1,358 Views)

@paul.r wrote:

Either way, I think the better solution is maintaining the data and updating the control directly - Altenbach's solution is exactly what I was getting at. 


I agree that the approach used by the OP is sub-optimal. I also appreciate the insight that was gained by answering the original question.

 

The knowledge that the "element" property points at the active value may offer a cleaner approach when I am dealing with a GUI supported by an event registered against a 2D array for "Value Changed". Before that adventure yesterday, I would have most likely been doing a compare of the Old and New values to discover which element had changed. But knowing that the "element" property of the array points at the element that has the key focus, I may be able to implement the event more efficiently. This could be important if I am dealing with a large array.

 

So knowing more than one way to get home from work is not a bad thing.

 

Thanks for the adventure!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 17 of 26
(1,340 Views)

@Ben wrote: 

The knowledge that the "element" property points at the active value may offer a cleaner approach when I am dealing with a GUI supported by an event registered against a 2D array for "Value Changed". Before that adventure yesterday, I would have most likely been doing a compare of the Old and New values to discover which element had changed. But knowing that the "element" property of the array points at the element that has the key focus, I may be able to implement the event more efficiently. This could be important if I am dealing with a large array.

 

So knowing more than one way to get home from work is not a bad thing.

 

Thanks for the adventure!

 

Ben


This is pretty much what I do.

Array Get Selection.png

Message 18 of 26
(1,328 Views)

My approach is not sub-optimal, it is completely unworkable.  My goal is to allow the user to use the scroll bar to view all array elements but any interaction by the user may change the key focus. 

If the documentation had been clear about this, I never would have gone down that path!

0 Kudos
Message 19 of 26
(1,319 Views)

@itronChiraldude wrote:

My approach is not sub-optimal, it is completely unworkable.  My goal is to allow the user to use the scroll bar to view all array elements but any interaction by the user may change the key focus. 

If the documentation had been clear about this, I never would have gone down that path!


I do not think the documentation staff ever considered what you were trying as being possible let alone actually trying to do it.

 

Re: That path

See here

 

Now to try and put a positive spin on it... At the least the team here may have demonstrated their talent and quality of their insight. Hang out here long enough and you will get a chance to see the accidents of other and learn how to avoid those missteps.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 26
(1,313 Views)