When working with Arrays via VI Server (similar to a previous idea) it's challenging to get at a single element of the array.
My workaround involves setting only one array cell visible and then changing the index to move to different elements....
Why can't we read / write the current active index of the array via Property node?
> Why can't we read / write the current active index of the array via Property node?
Because there is only one array element control. LV instantiates only a single copy of the array control and draws it multiple times with each index's value. It would be impossible to have independent properties for each index without instantiating N controls where N is the number of elements currently in the array, which would be a huge memory allocation (because even if only 4 are showing, as soon as you start scrolling through the array, you would want to have each individual control show its individual properties -- color, etc). Also, some properties have to be kept in sync (notably size, which implies others, such as font height).
If you want properties per array element, you have to manage all the overhead yourself. Create a cluster of N copies of the element, a scroll bar control (or an array index numeric control) and then update the N displayed elements as the user "scrolls" through the data. This is a very non-trivial operation, and the overhead incurred is specific to every implementation of the display. That's why LV cannot build a generic implementation without a huge amount of memory overhead.
I am not referring to cosmetic changes. I am not asking for all references of a single array element to be
index-specific. I don't want any change in that regard at all.
I am referring in essence to the "Value" and "Value Signalling" property of the "Element" object.
We can set the value of a SINGLE array element using this method but any cosmetic changes affect ALL array elements.
So in Effect, the Value property IS independent for each array element, and it is basically THIS property which can be indexed (using some tedious workarounds) to access single elements of an Array whose reference has been passed to a subroutine.
I only want to be able to choose which actual element the "Array element" property is pointing to so that the "Value" property which IS independent for each Array element becomes useful.
No further comments on this?
Is it at elast acknowledged that what I want should NOT require the huge memory allocation Aristos was talking about?
Why even have the "Array Element" - "Value" property if there's essentially no way of knowing which array element it is?
BTW, there IS the ability to set the Array index programatically but his doesn't work if there is more than one array element visible at a time. Any given array element can be the "Active" one at any time and there's no way of finding this out. The only workaround is to temporarily set only a single array element visible, do the operations and then set the visibility back to normal....
Can you post an example showing this? I have also been scratching my head as a long time LabVIEW user trying to do something that I thought would be very simple: programmatically thru property nodes have the array index set = 0 when a user first enters one of my modules.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.