12-19-2012 04:06 PM
Hello,
I am trying to average dynamic data over the course of 5 seconds and write the average of those 5 seconds to file at the push of a switch.
I have figured out how to get a switch to turn on for five seconds and then turn off when switched, but I am having a hard time figuring out how to average the data and write one line to the output file.
I have tried using the Collector Express VI paired with the Statistics VI, but the output is acting strangely.
I have attached what that output looks like here as test1
I would like to use a while loop with a shift register to make this work, but I am not sure how to advance.
Any Ideas?
12-19-2012 04:10 PM
I could not attach the file for unknown reasons, here is a screen shot of what it looks like.
12-20-2012 09:17 AM
Hi aem64,
It appears that you the data you converting to Dynamic Data is of type Double. A double is a single value and not a collection of data over time. Attached below are links to some examples that will hopefully prove to be useful. One uses shift registers to average data over a certain number of iterations, while the other shows how to use a shift register to build an array of collected data over a period of time. I hope this helps!
Average Last Five Values
https://decibel.ni.com/content/docs/DOC-4013
Acquire Data, Build Array, Find Maximum
https://decibel.ni.com/content/docs/DOC-3883