LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling of dynamic data structures

Dear all,

 

I am working on data analysis VI and I have a problem with data repository. The situation now is the following: VI analyses data from several measurement sites and in each site there are several measurement points including two measured values e.g. 10 sites, 10 points in each site, 2 values in each point. Now VI uses 3D-array which is practical enough for viewing purposes, but problems arise when user wants to trim the data, discard some points. Then the subarrays have different dimensions that does not work. The number of the sites and the number of meusurement points are dynamic, dependent on user's choice (could be hundreds). So I can't make the repository structure ready in advance, it must be programmatically controlled.

 

My goal is working VI which enables the user to discard different amout of points in each site and view the orginal data and also trimmed data from all sites in same time. What is the best data structure for my needs?

 

Description was more or less tangled, questions are more than welcome. My new LabVIEW user, so this may be simple and stupid question but I have worked on it for awhile without any decent solution.

 

Thank you in advance.

0 Kudos
Message 1 of 3
(2,661 Views)

For reasons which you just discovered, it isnt good to completely discard values from an array.

This can lead to having arrays of different lengths so they arent plotted correctly.

 

Whenever I need to remove data points, instead of removing them, I replace them with NaN.

This maintains the size of the array, but ignores the NaN points.

Cory K
0 Kudos
Message 2 of 3
(2,652 Views)
Another simple option is to use an array of clusters of arrays. Basically, each test site's data is contained in a cluster. In the cluster is your array of points (which can be a cluster of 2 values). An array of this high-level cluster would be your array of sites. Each site can have a varying length of points. Visually, it would look like this:
Download All
Message 3 of 3
(2,630 Views)