LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read TDMS - Calculate Average

Solved!
Go to solution

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.

0 Kudos
Message 1 of 6
(2,972 Views)
Solution
Accepted by topic author Vinc_sp

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.

0 Kudos
Message 2 of 6
(2,970 Views)

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.

 

Download All
0 Kudos
Message 3 of 6
(2,958 Views)
Solution
Accepted by topic author Vinc_sp

@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. 


GCentral
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
0 Kudos
Message 4 of 6
(2,950 Views)

@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.


GCentral
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
0 Kudos
Message 5 of 6
(2,947 Views)

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.

0 Kudos
Message 6 of 6
(2,943 Views)