From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

displaying array data

Solved!
Go to solution

I have an array of clusters.  Each cluster element contains a bunch of pieces of data for one sample.  The index of the array tells which sample number. 

 

The array size will not be determined until run-time since the user will determine how many samples they want to test.  I am not sure how i could go about displaying all of this information.  What i would like to see is a screen that displays all the data from a single cluster (one element of the array), with a combo box or something that can select a different sample, which would cause it to then fill in all the fields with the data from whatever sample chosen. 

 

I have 36 pieces of data to display for each sample, so having all the data from all the samples displayed at once will get out of hand fast...especially with the typical sample size of 6 which would result in 216 boxes on the FP.

0 Kudos
Message 1 of 8
(2,914 Views)

It kind of depends on how you've constructed the cluster, and whether it's suitable for a top-level GUI. You could simply have a cluster array indicator set to see just one element, and let the user use the index display to control which sample to look at. If you want to disassociate the index from the sample number (in other words, not make people remember that 0 = sample #1), then you can set which index is displayed via property nodes.

 

However, it sounds as if you want to format the display a little differently from how you save it. For example, one element of the cluster may be a number, but you may want to display it as a slide. The easiest way to do this is to create a "for the user to see" cluster that has the same elements in terms of datatype, but not necessarily the same type of control/indicator (the number/slide being a perfect example of this). This will allow you to index out the element you want based on, say, a dropdown, and wire it to your display cluster. 

0 Kudos
Message 2 of 8
(2,903 Views)

All the data being displayed are just numbers in regular indicator boxes.  Im more worried about cluttering the screen with tons of these boxes.  I guess what i am looking to do is have a bunch of indicators on the page (one for each piece of data in the cluster) and then either a combo box or maybe a display with a tab for each sample.  Just so only the data for one sample is visible at a time but the user can pick which one they want to look at.

 

0 Kudos
Message 3 of 8
(2,893 Views)

I was thinking of doing it with a tab control, but the only issue i am coming across is how to deal with the fact that the sample size can vary.  I could make a tab for each sample if i knew how many there were.  Is there a way to change the number of tabs in a tab control based on the number of samples in a given test?

 

0 Kudos
Message 4 of 8
(2,890 Views)
Solution
Accepted by topic author YoMetric

You certainly don't need a combo box. All you would need is a numeric control wired to the Index Array function. Take the element that comes out and wire it to an Unbundle/Unbundle by Name. Create an indicator for each element in the cluster.

 

 Index Cluster Array.PNG

 

0 Kudos
Message 5 of 8
(2,887 Views)
yeah thats basically the setup i have, but because of the sheer number of numeric indicators i would have, i'd like to have them organized by sample number in a tab control box.  Is there any way of setting the number of tabs during runtime or does that have to be done ahead of time?
0 Kudos
Message 6 of 8
(2,877 Views)

You can't set the number of tab pages at run-time. The tab control is essentially an enum.

 

Note: The above neglects scripting, but I don't recommend this as a viable solution anyway. 

 

I don't understand your comment/concern about the "sheer number of indicators". You said you have 36 elements in your cluster. Thus, to show one sample you need to have 36 indicators (if you don't use a cluster). If you use a tab you're still going to have 36 indicators, on each page. How does using a tab reduce the number of indicators? Neither I nor Dennis are recommending creating (36 X number of samples) indicators. We're saying to just have 36 indicators, and update the values based on which sample number is selected. Whether you want to have 36 separate indicators, or a single cluster of 36 indicators (wired directly to the Index Array function's output in Dennis' example) is up to you. 

0 Kudos
Message 7 of 8
(2,870 Views)
Oh, right.  I get what your saying now.  That should work fine then.  I dont really need the tabs if i control the data sent to the indicators by a numeric control adjusting the index of that index array function.  Sorry, my brain must already be on vacation haha.  Thanks a lot guys.
0 Kudos
Message 8 of 8
(2,867 Views)