LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data in a 4D array and make partial plots in real time?

Hi, this is a little complex, so bear with me...

I have a test system that tests a number of parts at the same time. The
experiment I do consists of measuring a number of properties of the
parts at various temperatures and voltages. I want to save all the
measured data in a 4-dimensional array. The indices represent,
respectively, temperature, voltage, part, property.

The way the experiment is done, I first do a loop in temperature, then
in voltage, then switch the part. At this point, I measure all the
properties for that condition and part and want to add them as a 1D
array to the 4D array.

At the same time, I want to make a multiple plot (on an XY graph) of
one selected property and part (using two pull-down selectors near the
XY graph) vs. voltage. (The reason I need to use an XY graph and not a
waveform graph, which would be easier, is that I do not have
equidistant steps in voltage, although all the voltage values I step
through are the same for all cases). The multiple plots are the data
sets at different temperatures. I would like to draw connection lines
between the points as a guide to the eye.

I also want the plot to be updated in the innermost for loop in real
time as the data are measured. I have a VI working using nested loops
as described above and passing the 4D array through shift registers,
starting with an array of the right dimensions initialized by zeroes. I
know in advance how many times all the loops have to be executed, and I
use the ReplaceArraySubset function to add the measured properties each
time. I then use IndexArray with the part and property index terminals
wired to extract the 2D array containing the data I want to plot. After
some transformation to combine these data with an array of the voltage
values in the form required to pass to the XYGraph control, I get my
plot.

The problem is: During program execution, when only partial data is
available, all the zero elements in the array do not allow the graph to
autoscale properly, and the lines between the points make little sense
when they jump to zero.

Here is how I think the problem could be solved:
1. Start with an empty array and have the array grow gradually as the
elements are measured. I tried to implement this using Insert Into
Array. Unfortunately, this VI is not as flexible as the Replace Array
Subset, and does not allow me to add a 1D array to a 4D array. One
other option would be to use the Build Array, but I could not figure
out if this is usable in this case.
2. The second option would be to extract only the already measured data
points from the 4D array and pass them to the graph
3. Keep track of the min. and max. values (only when they are different
from zero) and manually reset the graph Y axis scale each time.

Option 3 is doable, but more work for me.....
Option 2: I first tried to use Array Subset, but this always returns an
array of the same dimensionality of the input array. It seems to be
very difficult, but maybe not impossible, to make this work by using
Index Array first followed by Array Subset. Option 3 seems easier.
Ideally, I would like option 1, but I cannot figure out how to achieve
this.

Your help is appreciated, thanks in advance!

--
germ Remove "nospam" to reply
0 Kudos
Message 1 of 4
(3,304 Views)
Greetings!

You can use any of the 3D display vi's to show your "main" 3d data, and then use color to represent your fourth dimension. This can be accessed via the property node. You will have to set thresholds for each color you use, which is quite simple using the comparison functions. As far as the data is concerned, the fourth dimension will be just another vector (column) in your data file. Also, check out the BUFFER examples for how to separate out "running" data in real time. As far as autoscaling is concerned, you might have to disable it, or alternatively, you could force a couple of "dummy" points into your data which represent the absolute min/max you should encounter. Autoscaling should generally be regarded as a default mode, just to get things
rolling, it should not be relied on too heavily for serious data acquisition. It's better to use well-conditioned data, or some other means, such as a logarithmic scale, to allow access to all your possible data points.

Good Luck!

Eric
Eric P. Nichols
P.O. Box 56235
North Pole, AK 99705
0 Kudos
Message 2 of 4
(3,304 Views)
In article <506500000005000000AD5A0100-1075935269000@exchange.ni.com>,
chutla wrote:

> Greetings!
>
> You can use any of the 3D display vi's to show your "main" 3d
> data, and then use color to represent your fourth dimension. This can
> be accessed via the property node. You will have to set thresholds
> for each color you use, which is quite simple using the comparison
> functions. As far as the data is concerned, the fourth dimension will
> be just another vector (column) in your data file.


chutla, thanks for your post, but I don't want a 3D display of the
data....


> Also, check out
> the BUFFER examples for how to separate out "running" data in real
> time.

Not clear to me what you mean, but will c
heck the BUFFER examples.


> As far as autoscaling is concerned, you might have to disable
> it, or alternatively, you could force a couple of "dummy" points into
> your data which represent the absolute min/max you should encounter.
> Autoscaling should generally be regarded as a default mode, just to
> get things rolling, it should not be relied on too heavily for serious
> data acquisition. It's better to use well-conditioned data, or some
> other means, such as a logarithmic scale, to allow access to all your
> possible data points.



I love autoscaling, that's the way it should be.

--
germ Remove "nospam" to reply
0 Kudos
Message 3 of 4
(3,304 Views)
Instead of a zero array, consider the use of NaN (not a number) for initilizing doubles. The use of NaN causes the XY graph not to plot that point
0 Kudos
Message 4 of 4
(3,304 Views)