LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

collector output garbage when written to file?

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?

0 Kudos
Message 1 of 3
(2,134 Views)

I could not attach the file for unknown reasons, here is a screen shot of what it looks like.

Download All
0 Kudos
Message 2 of 3
(2,132 Views)

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

Josh B
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,098 Views)