# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Read TDMS - Calculate Average

Hello,

I acquired data which I stored in a TDMS file and I'd like to make some calculations such as find the mean of my data set.

I successfully read the TDMS file and linked it to a waveform graph, no problem on this part.

However I'm stuck when trying to understand how can I get access to the data other than just to print them on a graph.

How could I sum all the values to find the mean value ?

I'm using LabVIEW 2010.

Thank you.

Message 1 of 6
(3,146 Views)
Solution
Accepted by topic author Vinc_sp

## Re: Read TDMS - Calculate Average

Use the Mean.vi function under the probability and statistics.  I'm guessing you are reading a waveform and may need to pull out the Y values using the Get Waveform Components function.  Post some code if you are stuck.

Message 2 of 6
(3,144 Views)

## Re: Read TDMS - Calculate Average

Well, thanks I made a big step. However the result returned is 0.00.

What am I missing ?

I've attached my code and a pic of the waveform.

Message 3 of 6
(3,132 Views)
Solution
Accepted by topic author Vinc_sp

## Re: Read TDMS - Calculate Average

@Hooovahh wrote:

Use the Mean.vi function under the probability and statistics.  I'm guessing you are reading a waveform and may need to pull out the Y values using the Get Waveform Components function.  Post some code if you are stuck.

No need to pull out the Y.  There is a Waveform DC/RMS measurement VI that will do the job.

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 4 of 6
(3,124 Views)

## Re: Read TDMS - Calculate Average

@Vinc_sp wrote:

Well, thanks I made a big step. However the result returned is 0.00.

Based on the data, that is perfectly reasonable.  Try changing your display option for the indicator to Exponential or SI notation and you should see more digits of precision.

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 5 of 6
(3,121 Views)

## Re: Read TDMS - Calculate Average

Thank to you too !

My 0.00 problem was solved actually I don't really know how. It was a matter of values after the decimal. I just created a new dbl numeric constant which I changed into an indicator.

I attach my code in case someone face the same problem.

Message 6 of 6
(3,117 Views)