LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Properties for Individual Elements in Arrays & Clusters

Indexing an Array's individual elements is easy with a For loop; however, setting individual Properties for each element is impossible by the fact that all array elements are geared to have similar properties (such as Colors, Labels, etc.).
Clusters, on the other hand, readily allow varying properties for individual elements, however prgrammically indexing each element via an auto-index routine is virtually impossible.

With this said, I'll attach a LV6 VI (see answers with my VI) showing a manual way of taking an array of properites and matching them with an array (turned into cluster) of elements.
However, I am looking for efficiency in code, and have not yet found the right mixture of re
ferences, arrays, and clusters to set such properties.

I have studied many of the ideas presented here at the DV, but nothing exact that captures all I've mentioned.

Any ideas how to smartly implement property functions using auto-indexing routines for arrays/clusters as I mention??

Thanks for any thoughts and appreciate any examples (or words) which you can share,
Doug
0 Kudos
Message 1 of 7
(2,919 Views)
Message 2 of 7
(2,919 Views)
Two techniques shown in the attached file:
1-Get an array of references to cluster controls to modify properties in a for loop
2-"Make all Data"; since only the data changes from array element to the next, make the cosmetics data using color boxes and picture rings. Rings are useful because you can disable items.

Jean-Pierre Drolet
Scientech R&D


LabVIEW, C'est LabVIEW

Message 3 of 7
(2,919 Views)
Very good! Four stars to you! /Mikael
0 Kudos
Message 4 of 7
(2,919 Views)
Jean-Pierre,
Absolutely perfect - I knew there was a better way, but I just kept missing.
Thank you for your time and effort - you always have great responses, and obviously are a great reference for those References (pun intended).
****, Doug
0 Kudos
Message 5 of 7
(2,919 Views)
Don't forget to Close Reference within the for loop or whatever loop it is. If your application use a lot of reference in looping structure. Your application is allocating memory each time the loop is executed. It create some sort of a temporary reference and you have to close this reference your self.
0 Kudos
Message 6 of 7
(2,919 Views)
nitrof,

Wondering if this is still true for While loops.... If so, would you show
me how to do this? I've been looking for a way to release the memory....

Reg

"Nitrof" wrote in message
news:506500000005000000A3740000-1019262487000@exchange.ni.com...
> Don't forget to Close Reference within the for loop or whatever loop
> it is. If your application use a lot of reference in looping
> structure. Your application is allocating memory each time the loop
> is executed. It create some sort of a temporary reference and you
> have to close this reference your self.
0 Kudos
Message 7 of 7
(2,919 Views)