LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to average n consecutive blocks of data from balance in labview

Solved!
Go to solution

We are continuously acquiring data from balance at the rate of 1 data per second which is 60 data per minute. Our requirement is to split those 60 data into successive blocks of 5 datapoints and take average for every 5 datapoints thereby getting 12 blocks of datapoints (60/5) for which average is taken and 1 data point per minute is obtained. This has to be repeated for every minute. Tried various ways using arrays but not working out. Please HELP!

0 Kudos
Message 1 of 7
(1,098 Views)

What have you tried? Post your code so that we can help to figure out what went wrong.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 7
(1,062 Views)

one way would be creating a circular buffer, every new data set is sent to the buffer. Once the buffer is full, you can start averaging the data on the buffer according to your specs, this way you don't loose data, and will have an averaged data set at the same time that the data is being acquired. 

Every time the buffer is full, you can then start averaging the data, split the data set in chunks of 5 and average them. 

 

0 Kudos
Message 3 of 7
(1,057 Views)

snip.png

0 Kudos
Message 4 of 7
(1,030 Views)
Solution
Accepted by Labwizard

May all you need is mean ptbypt, then decimate the output.

0 Kudos
Message 5 of 7
(1,024 Views)

Will it work if we simply keep two mean blocks one after the other and give sample length 5 for first block and 12 for second block?....will the second block wait till it gets 12 values from first block?

0 Kudos
Message 6 of 7
(968 Views)

@Labwizard wrote:

Will it work if we simply keep two mean blocks one after the other and give sample length 5 for first block and 12 for second block?....will the second block wait till it gets 12 values from first block?


I don't know which post you are replying to, but what is a "block"? Can you explain what you are talking about?

 

Functions execute once all inputs have data. Right?

I am not sure why you take the average twice? Taking the average of five 12 times is the same as averaging 60 points directly.

0 Kudos
Message 7 of 7
(959 Views)