‎04-23-2025 05:28 AM
So, I have a program that outputs that reads data and outputs an array. And I want to display this data. So for now I know the maximum size of the array is 18. So i created 18 numeric indicators and gave the value of each array in each numeric indicator. If not all 18 are used, i.e if the output array size is less than 18 then i will disable and gray out the unused numeric indicators. But my boss told me, its 18 for now, in future it can 30 or 70 or 100 etc. So instead of using numeric indicators i need to display this array output nicely. I thought of converting into a 2d array with number of rows being 7. But then the problem is, if the array size is 18, then in the 2d array first column will have 7 values, second will have 7 values and third will also have 7 values, the 4 remaining values plus extra 3 values of just 0. I dont want those 3 values. So now Iam running out of ideas to neatly display those values. Does anyone know a good method for that. Thank you.
Solved! Go to Solution.
‎04-23-2025 05:39 AM - edited ‎04-23-2025 05:41 AM
Hi govindsankar,
@govindsankar wrote:
But my boss told me, its 18 for now, in future it can 30 or 70 or 100 etc. So instead of using numeric indicators i need to display this array output nicely. I thought of converting into a 2d array with number of rows being 7. But then the problem is, if the array size is 18, then in the 2d array first column will have 7 values, second will have 7 values and third will also have 7 values, the 4 remaining values plus extra 3 values of just 0. I dont want those 3 values. So now Iam running out of ideas to neatly display those values. Does anyone know a good method for that.
Convert your array of numeric data to an array of string data: strings can be empty, numerics always have a value!
Then you can show your 2D array of strings (or a table or a multicolumn listbox/MCLB) with some empty elements…
(You can also set the number of visible array elements at runtime in each dimension. With listboxes you can use their scrollbars easily to allow for very large number of elements. For even larger amounts of data a graph might be suitable…)
@govindsankar wrote:
So i created 18 numeric indicators and gave the value of each array in each numeric indicator. If not all 18 are used, i.e if the output array size is less than 18 then i will disable and gray out the unused numeric indicators.
What a horrible idea…
‎04-23-2025 07:53 AM
@GerdW wrote:
Hi govindsankar,
@govindsankar wrote:
But my boss told me, its 18 for now, in future it can 30 or 70 or 100 etc. So instead of using numeric indicators i need to display this array output nicely. I thought of converting into a 2d array with number of rows being 7. But then the problem is, if the array size is 18, then in the 2d array first column will have 7 values, second will have 7 values and third will also have 7 values, the 4 remaining values plus extra 3 values of just 0. I dont want those 3 values. So now Iam running out of ideas to neatly display those values. Does anyone know a good method for that.Convert your array of numeric data to an array of string data: strings can be empty, numerics always have a value!
Then you can show your 2D array of strings (or a table or a multicolumn listbox/MCLB) with some empty elements…
(You can also set the number of visible array elements at runtime in each dimension. With listboxes you can use their scrollbars easily to allow for very large number of elements. For even larger amounts of data a graph might be suitable…)
@govindsankar wrote:
So i created 18 numeric indicators and gave the value of each array in each numeric indicator. If not all 18 are used, i.e if the output array size is less than 18 then i will disable and gray out the unused numeric indicators.
What a horrible idea…
To expand a bit on this suggestion:
Make sure this converted data is for display purposes only. Don't re-convert it to do calculations. Just thought I'd put that out there considering the concepts you (OP) are struggling with.
‎04-23-2025 08:01 AM
Decided to use multicolumn listbox
‎04-29-2025 06:00 AM
If they're different lengths you can have an Array of Cluster with a 1D array in it.
‎04-29-2025 10:20 AM
@govindsankar wrote:
Decided to use multicolumn listbox
This is a mistake unless you need listbox functionality. A table is much easier to update, just use a wire, a listbox requires a property node.
‎04-29-2025 10:55 AM
Typically these types of APIs allow you to read incrementally. So you call it in a loop until bytes returned is less than your buffer,numbytestoread, or you get a terminator. Don’t forget to store each buffer you read to recombine the data.