LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically controling the size (in pixels) of array elements?

Solved!
Go to solution

Hey Everyone,

I am writing a large vi where front panel space is becoming a limitation.   One of the elements that I want to display is a 2-D array of boolean indicators (rectangular LEDs).  Is there any way to dynamically resize the elements in the array so that regardless of the number of elements, the entire array is always visible and has a constant footprint.  For example, say the array is 8 x 8 elements, and takes up 160x160 pixels on the front panel so each element is roughly 20x20 pixels.  Then the number of elements shifts to 4x4.  I want the display to stay 160x160 pixels, but the size of each element to double to 40x40 pixels.  Is this possible?

Thanks all,

Matt

0 Kudos
Message 1 of 10
(3,919 Views)

Me again.

Forgot to note, using LabVIEW 8.2 FDS.  So, no Xcontrols for me.

M

0 Kudos
Message 2 of 10
(3,916 Views)

On the FP right click on just the element in the array (make sure you have not clciked on the whole array) and choose create reference or property node. The bounds should let you specify the size down to a certain minimum. For booleand from the clasic palette they can be made smaller than the modern versions since they don't have a border.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 10
(3,913 Views)

Why don't you covert the boolean array to 0,1 and use an intensity graph instead? Set the scaled to autoscale and the rest should fall into place.

 

Else you could use two property nodes. One for the element (button size) and one for the array container (numrows, numcolumns). See attached quick draft.

Message 4 of 10
(3,906 Views)

Ben wrote:

The bounds should let you specify the size down to a certain minimum.


Ben, "bounds" is read only. Only "button size" will work. See my demo above.

Message 5 of 10
(3,904 Views)

Thanks Ben,

I was just missing the right property.  I was looking at "Bounds", which is read only.  Didn't see the "Button Size" property.

0 Kudos
Message 6 of 10
(3,897 Views)
Solution
Accepted by topic author Munson1027

The intensity graph solution is probably a bit simpler. Here's an example. (The advantage is that the bounds of the graph remain completely static).

 

 

Message 7 of 10
(3,894 Views)

So thank you for two great ideas/examples.  Definitely think I have a couple of very workable approaches.  I have a follow on question about using the intensity graph approach.

 

First some background.  This indicator is going to show the progress of a sorting operation, 1-4 copies of 1-8 unique items are being sorted into 1-32 containers.  The items arrive at the sorter in random order, are identified, and then placed into the container where they are still needed.  The point of this indicator is to show the user, at a glance, how full each container is andwhich componenets are missing.  I want the elements (columns) to appear different for the unique items, which I know you can't do in an array of booleans.  So I had already dumped the boolean approach for an array of colorboxes, and it was the color boxes that I was trying to dynamically size. There is still a boolean array to keep track of if an item has arrived, but that array drives the array of colorboxes where each type of item is color coded by assigning a gray value to colorbox for false, and a particular color if true.  See attached, which works pretty well (detailed adjusts will make it just right).

 

I think the intensity graph will look much nicer though, so here is the question:

 

How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines?  The attached get vi puts out a different value for each yes/no, which is to say I already know how to take the boolean and convert the 1 state to a unique number, what I don't know how to do is map that number into a particular color on the intensity graph.

 

Thanks guys.

Super helpful as always!

Matt

 

 

 

 

 

0 Kudos
Message 8 of 10
(3,870 Views)
I haven't tried this, but it looks like the color mapping is straightforward; look at the help for intensity graphs under "color mapping" and it explains which property node to use to set a mapping between a value and a specific color.
0 Kudos
Message 9 of 10
(3,857 Views)

Munson1027 wrote:

How do I map the different colors onto the intensity graph so it looks like the colorbox array without the lines? 


You can just right-click on a marker on the z-scale and select the marker color. In your case you only have two colors total, so things are quire trivial. 🙂

0 Kudos
Message 10 of 10
(3,829 Views)