LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Full Display Of a(n) (dynamic) Array

Solved!
Go to solution

Hello.

 

I need to automatically display all the values of an array.

E.g.: let's consider the array below:

 

Array Maximum Size Automatic.png

 

After execution, I have a 5x5 array, but because of arrays default options, all I can see is the first element (Array[0] [0])
unless I intentionally extend it to 5X5.

Besides, Array should normally be dynamic (here I made it static with 5x5 loops, for the illustration); so if the number of loops increases, I will have to extend it again to display the full array.

 

Out of concern for monitoring, how can I make this all automatic?

 

Thank you in advance.

 

 

0 Kudos
Message 1 of 14
(3,933 Views)

Set the properties "number of columns" and "number of rows" of the array indicator to their appropriate value.

Please note that this easily destroys all graphical schema you plan to your front panel so you should limit the maximum sizes you allow and leave appropriate space on the front panel.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 14
(3,924 Views)

Hello AlainKabs,

 

You can take a look at the array indicator properties NumCols and NumRows.

 

array.png

0 Kudos
Message 3 of 14
(3,922 Views)

The Matrix Size comes in handy here.  I fully agree with Norbert that you really need to limit how large the display will be.  Another option is to just size it to the maximum size you can show and just let the values fill in as it can.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 14
(3,915 Views)

Thanks to everyone for all the contributions.

Now, things become much complicated.

 

Thanks to your answers, I am now able to display my entire Array; but when I bundle my array with something else (here some text), the full display does not apply inside the cluster Result.

Array auto size in Cluster.png

 

 

The Result display sticks to the initial display, it does not fit onto what I expect.

 

Result 3x3.JPG

 

 

This is actually what I wanted from the beginning but did not know that solving the 'full array display' problem would only be a part of the solution...

0 Kudos
Message 5 of 14
(3,867 Views)

Why are you expecting a 4x4 result when you tell the for loops to iterate only three times?  Note the "3" in the top-left corner of your code?

 

In other words, I don't see how your "expected" result could possibly be created by this code.

0 Kudos
Message 6 of 14
(3,860 Views)

Hi Alain,

 

you create a 3×3 array and you get a 3×3 array.

So what's the point?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 14
(3,854 Views)

Why would you expect your cluster to contain arrays with 4 columns and rows, your loops are set to run 3 times each.  When I set the constant to a 4 it looks like the expected.

 

EDIT: Slowest of the 3.

0 Kudos
Message 8 of 14
(3,853 Views)
Solution
Accepted by topic author AlainKabs

@AlainKabs wrote:

Thanks to everyone for all the contributions.

Now, things become much complicated.

 

Thanks to your answers, I am now able to display my entire Array; but when I bundle my array with something else (here some text), the full display does not apply inside the cluster Result.

...


That is because in your code you set the properties of the indicators to display those sizes, but then you bundled the data in the indicators into a cluster and put that into a new indicator.  You need to set the properties of that new cluster indicator now to display the size that you want.

 

You can use the Controls[] property of the cluster indicator to get references to all controls in the cluster, then set their appropriate NumRows and NumCols properties.



0 Kudos
Message 9 of 14
(3,852 Views)

Sorry, this is a wrong illustration, the first time, I ran the VI with a 3x3, then I built the cluster.
The second time, when I tried with 4, I noticed the problem. So the illustration is from the second test.

0 Kudos
Message 10 of 14
(3,851 Views)