LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Computing Average and Writing to Measurement File

Hi, 

 

I'm new to labview and I was hoping to get some guidance and would appreciate any help or advice I could get. 

 

I am trying to configure a code that'll calculate the average of numbers that I'll manually input into an array, then using the measurement to file function to export it to an excel sheet. 

 

I was thinking of creating an array to input my numbers then using the mean.vi function to calculate the average?

 

I want to test out the code by manually inputing numbers, but my final project consists of a DAQ retrieving data and wiring through a sample compression, then from there, taking averages of the numbers from the sample compression at X time then exporting that data. 

 

Any advice? 

Thanks in advance! 

0 Kudos
Message 1 of 2
(2,405 Views)

Write Test (a.k.a. Small Demo) routines as you go.  For example, generate an array of 10 numbers with a For loop surrounding the Random Number Generator, write it to a Measurement File, take its mean, put the Array and the Mean on the Front Panel, then run it and see if it works.  [Quick -- what should be the mean of 10 U[0, 1] random numbers, where U[0, 1] means "Uniformly distributed between 0 and 1?].  As a second test, make an array from the For loop's Index ["i"], and see if the mean is 4.5.  Do the Excel files look the way you hope?

 

With such simple code (you should be able to knock this out in 5 minutes), you can quickly see if you have the Big Picture right, then can think about making it more complicated.

 

Bob Schor

Message 2 of 2
(2,390 Views)