LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I average samples and then write the data to file?

I am working with a VI dealing with the use of thermocouples.  I have the VI set to write the data recorded to a file at certain time intervals.  I would like to know how it would be possible to take the average of these samples and then write the data to file.  How can I do this?
0 Kudos
Message 1 of 6
(2,910 Views)
You could store you samples in a queue and once the time interval that you want to write to file is up you can dequeue your elements and get your average then write them to file.  Does this need to execute at a fast rate?
0 Kudos
Message 2 of 6
(2,909 Views)
It would need to execute in a reasonable amount of time.  For example, right now I have the write to file executing every 30 seconds. 
0 Kudos
Message 3 of 6
(2,884 Views)
Could you please attach your vi so that I can take a look at it.   I just want to make sure that we are on the same page.

Cheers!
0 Kudos
Message 4 of 6
(2,878 Views)
Certainly  Attached you will find a recent copy of my VI
0 Kudos
Message 5 of 6
(2,875 Views)
Thank you.  I dont see any logic for your timing to write to file, I do see the logic that triggers the boolean indicator when time increment is up.  Do you plan to put your "Write to Measurement File" piece inside of a case structure?  Just so we are clear, you want to take an average for each Temp (1-12) each iteration of your while loop?  Let me know if we are on the same page.

Cheers
0 Kudos
Message 6 of 6
(2,873 Views)