NI Home > Community > NI Discussion Forums

LabVIEW Idea Exchange

Announcements
We've turned on a search before post feature in the LabVIEW Idea Exchange. This new feature will help cut down on the number of duplicate ideas in this space!

The NI Idea Exchange is a product feedback forum where NI R&D and users work together to submit ideas, collaborate on their development, and vote for the ones they like best. View all of the NI Idea Exchanges to post an idea or add your opinion on an existing one today!
Intaris

Array active index via Property node

Status: New
by Trusted Enthusiast on ‎06-12-2009 12:35 PM

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?

 

Shane.

Comments
by Trusted Enthusiast on ‎06-12-2009 06:06 PM

> 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. 

by Trusted Enthusiast ‎06-15-2009 07:37 AM - edited ‎06-15-2009 07:38 AM

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.

 

VI Server (Array Element).PNG

 

Shane.

Message Edited by Intaris on 06-15-2009 07:38 AM
by Trusted Enthusiast on ‎06-17-2009 01:20 AM

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?

 

Shane.

by Trusted Enthusiast on ‎06-17-2009 01:42 AM

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....

 

Shane.

by Active Participant DonRoth on ‎08-27-2010 07:51 AM

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.

 

Thanks,

 

Don

Latest LabVIEW Idea Exchange Blog Posts
About LabVIEW Idea Exchange

Have a LabVIEW Idea?

  1. Browse by label or search in the LabVIEW Idea Exchange to see if your idea has previously been submitted. If your idea exists be sure to vote for the idea by giving it kudos to indicate your approval!
  2. If your idea has not been submitted click Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
  3. Watch as the community gives your idea kudos and adds their input.
  4. As NI R&D considers the idea, they will change the idea status.
  5. Give kudos to other ideas that you would like to see in a future version of LabVIEW!
Idea Statuses
Top Kudoed Authors
User Kudos Count
79
47
37
34
34