# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Point by Point Values Incorrect

I am using a loop that gets data every 10 seconds or so (Ends up being a little more, but that doesn't matter.), and each time it gets data (temperature), it goes through the Point by Point Standard Deviation VI in order to produce a cumulative standard deviation and the mean. Previously, I was using the Point by Point Mean VI to get the mean, but learned the Standard Deviation VI had the mean included.

My wired terminals are x, standard deviation, mean

Unwired: sample length, initialize, error

I ran the VI overnight for a total of about 18 hours, where it collected every 10 seconds (6690 data points). The temperature that was read started at about 27 °C and cooled to 25 °C and then was held there. On the front panel, the reported average temperature (for the whole trial) was 24.977 ± 0.017 °C, which did not seem correct to me. So I imported the data into Excel and used "=AVERAGE()" and "=STDEV()" to get a value of 25.860 ± 0.774 °C.

Why is there a discrepancy in these values? The only thing I can think of is that the Point by Point Standard Deviation VI reset itself, but cannot think of why. Maybe because I did not wire any value to the "sample length" terminal, but I assumed that it would use the whole sample when unwired.

Message 1 of 3
(1,863 Views)
Solution
Accepted by topic author Quevvy

## Re: Point by Point Values Incorrect

Actually, the function is doing exactly what it is supposed to.  If you read the documentation, you will see that the VI only holds so many samples to do the calculation on (default to 100).  So it actually did a moving average/std deviation.  From the help:

sample length is the length of each set of incoming data. The VI performs computation for each set of data. The default is 100. When you set sample length to zero, the VI calculates a cumulative solution for the input data from the time that you called or initialized the VI. When the sample length setting is greater than zero, the VI calculates the solution for only the newest set of input data.

So what you really want to do is set the sample length to 0.   There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 3
(1,848 Views)

## Re: Point by Point Values Incorrect

@crossrulz wrote:

Actually, the function is doing exactly what it is supposed to.  If you read the documentation, you will see that the VI only holds so many samples to do the calculation on (default to 100).  So it actually did a moving average/std deviation.  From the help:

sample length is the length of each set of incoming data. The VI performs computation for each set of data. The default is 100. When you set sample length to zero, the VI calculates a cumulative solution for the input data from the time that you called or initialized the VI. When the sample length setting is greater than zero, the VI calculates the solution for only the newest set of input data.

So what you really want to do is set the sample length to 0.

I looked at that help file, but I must have missed that default value part.  I thought that not wiring it was the same as setting it to zero, but now I know! Ok thanks!

Message 3 of 3
(1,843 Views)