LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i disable specific array indexes, but not the whole array?

Basically, I have an array of values, some of them I would like to "gray out" (or disable, based on some condition), and others I would like to have enabled.

I want to grey out the whole row, not the column...

For example, I test one array value with 5 elements, and if element 5 is less than 2, gray it out (dont erase it or anything, just visually inform the user its disabled). Again, dont disable everything, just the array value that meets my criteria...

I know it has something to do with attribute nodes, but those things are tricky, especially with arrays where you can change properties for the whole array, and for certain indexes...

in the end, I would like something lik
e this:

index: value1 value2 (value 2 is the test)
0 2 2 (not disabled)
1 2 1 (disabled)
2 1 2 (not disabled)
3 3 3 (not disabled)
4 1 1 (disabled)

and so on...

i have labview 5.1
0 Kudos
Message 1 of 9
(5,784 Views)
As long as i know, there's only one thing that can be different between array components and that is (obviously) the value, so what you want is not possible with arrays (someone correct me if i'm wrong), perhaps if you know the array size you can use a cluster which leaves you the posibility of having an attribute node for each element inside it...
Good luck
0 Kudos
Message 2 of 9
(5,784 Views)
As long as you have arrays of numbers, the attached VI show few display
techniques to achieve want you want.

Jean-Pierre Drolet
Scientech R&D



[Attachment ArrayRing.vi, see below]


LabVIEW, C'est LabVIEW

Message 3 of 9
(5,784 Views)
The same VI saved under 5.0



[Attachment ArrayRing.vi, see below]


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 9
(5,784 Views)
you used the attribute "disabled items[]" or something similar. is that only available with rings? can you do anything like this with a simple array? your suggestion did just what I wanted, but I cant figure out how to add it to the existing code... I am using arrays, and dont want to change to much code, this addition is just for effect, so I dont want to spend too much time on it, when its only for looks 🙂
0 Kudos
Message 5 of 9
(5,784 Views)
The "disabled items" property is a ring and listbox property. It is not an
array property since all the rings in the array have the same disabled
elements. The look of disabled array elements is obtained by assigning
different values to array elements.

To include the technique in your VI, you can leave your code as is and
continue to use arrays but create an array of rings only for display
purposes. Instead of displaying the numeric array, you display the ring
array and properly assign Strings and disabled items properties.

Jean-Pierre Drolet

"P" a écrit dans le message news:
506500000005000000CA320000-993342863000@exchange.ni.com...
> you used the attribute "disabled items[]" or something similar. is
> that only available with
rings? can you do anything like this with a
> simple array? your suggestion did just what I wanted, but I cant
> figure out how to add it to the existing code... I am using arrays,
> and dont want to change to much code, this addition is just for
> effect, so I dont want to spend too much time on it, when its only for
> looks 🙂


LabVIEW, C'est LabVIEW

0 Kudos
Message 6 of 9
(5,784 Views)
You can't change the attribute for an individual array element without
changing it for all array elements. What I have done in the past to
'grey' out certain array data that were not meaningful was to make a
third array of booleans to overlay the ones you are interested in
masking. This overlay array is colored totally transparent, frame and
all (maybe a lt gray frame so you can see and move it during panel
construction), and the OFF state of the boolean is also transparent.
The index is sync'ed to the array of interest, and the boolean ON
state, which is of a color and size to nicely block the underlying
meaningless data, is TRUE whenever you want to disable the visibility
of the data underneath.

This approach takes a minimal amount of programming eff
ort. If
however, you want to do the same for an array of controls, you have to
mask them with individual booleans whose state never changes but whose
visibility property does. This means when the overlying boolean has
its visible property turned off, the underlying control is useable.
When the visible property is on, the do-nothing boolean catches the
mouse click (so make both ON and OFF states look
identical). Hope some of this helps...
0 Kudos
Message 7 of 9
(5,784 Views)
Thanks guys, those are 2 great suggestions. I will try them both and see how they work.

I never would have thought of those ways, cause I assumed arrays could disable different indexes, and I knew almost nothing about rings...

Thanks again
0 Kudos
Message 8 of 9
(5,784 Views)
> Thanks guys, those are 2 great suggestions. I will try them both and
> see how they work.
>
> I never would have thought of those ways, cause I assumed arrays could
> disable different indexes, and I knew almost nothing about rings...
>

Another thing that you can consider is to make a cluster that contains
a similar grid of controls. The cluster controls can have independent
attribute/property nodes. Use the array to cluster conversion function
to convert between them so that processing can be done on the array, but
the cluster can be used for display.

Greg McKaskle
0 Kudos
Message 9 of 9
(5,784 Views)