LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get rid of the gray null element in array controls

Normal labview array controls always have a grayed-out null element at the end, so that the user can add new data and expand the array. I'd like to define fixed-screen-size arrays for use on the front panel that do not have this gray null element.

 

Imagine an application that displays a dynamically configurable number of channel amplitudes.  You want to allow the user to scroll through a list of amplitudes, changing them at will, but you don't want the user playing with that last, gray null element; it can be awkward.  After all, I don't want the user adding a non-existent channel to the end of my amplitude list!  You could resize the array to hide the elemtn, but due to the limits of the GUI, the control must remain the same size.  Either there are not enough elements to fill the control, and the user sees grayed-out elements, or there are too many for the space, and a scroll bar is necessary, allowing the user to see one gray element at the end of the array.  There does not appear to be any array property which will allow a programmer to get rid of that pesky last null element.

 

Perhaps I've missed something obvious, but attached is a labview 2010 project that demonstrates how I've solved this problem, both traditionally and using an XControl.  Basically, I've synthesized what appears to be a statically-screen-sized array control using an array, a rectangle decoration, and a scroll bar control.  If someone has a more elegant solution, I'd love to know about it.

 

Here's a screen grab illustrating both the problem and a solution:

 

array demo.JPG 

Message 1 of 6
(4,906 Views)

I have not looked at your attachment yet, but it seems you should vote for this idea.

This definitely needs to be implemented and deserves many more votes than the current 36!

 

For my workaround, see the links in my reply.

 

 

 

Also note that array indicators already have this functionality fully implemented. (See here)

0 Kudos
Message 2 of 6
(4,901 Views)

Hi,

 

you can use this, make a cluster which has the number of controls you want to be used, then in the block diagram you can convert this cluster to array using the "cluster to array"function, by this the user will use only the number of controls inside the cluster only.

 

hope this helps

 

regards

0 Kudos
Message 3 of 6
(4,874 Views)

Zekasa,

  Thanks, I've tried this, but wind up with a standard-looking aray with a null element at the end, or null elements filling up the array if there aren't enough defined ones to fill the visible screen space - just as before.

0 Kudos
Message 4 of 6
(4,839 Views)

Altenbach,

  Kudos given (to the linked idea).  User Ben has a good idea, listed in the replies to this post, but it is only partially useful for me: he customizes an array control by replacing the index control with a slider.  However, it doesn't work with actual scroll bar controls, and it doesn't prevent null elements from being used to fill up the empty space when an array container is larger than the data list.

0 Kudos
Message 5 of 6
(4,838 Views)

@Code ferret wrote:

Altenbach,

  ... it doesn't prevent null elements from being used to fill up the empty space when an array container is larger than the data list.



You can programmatically set the size of the container (and slider in my example) if the array size is smaller than the current container size.

0 Kudos
Message 6 of 6
(4,810 Views)