04-07-2015 07:31 AM
Hello.
I need to automatically display all the values of an array.
E.g.: let's consider the array below:
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.
Solved! Go to Solution.
04-07-2015 07:49 AM
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
04-07-2015 07:52 AM
Hello AlainKabs,
You can take a look at the array indicator properties NumCols and NumRows.
04-07-2015 07:59 AM - edited 04-07-2015 07:59 AM
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.
04-09-2015 09:21 AM
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.
The Result display sticks to the initial display, it does not fit onto what I expect.
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...
04-09-2015 09:25 AM - edited 04-09-2015 09:28 AM
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.
04-09-2015 09:28 AM
04-09-2015 09:30 AM - edited 04-09-2015 09:31 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-09-2015 09:30 AM
@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.
04-09-2015 09:31 AM - edited 04-09-2015 10:01 AM
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.