取消
显示结果 
搜索替代 
您的意思是: 

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

已解决!
转到解答

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 项奖励
1 条消息(共 7 条)
2,568 次查看

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

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
0 项奖励
2 条消息(共 7 条)
2,532 次查看

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 项奖励
3 条消息(共 7 条)
2,527 次查看

snip.png

0 项奖励
4 条消息(共 7 条)
2,500 次查看
解答
接受人 Labwizard

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

0 项奖励
5 条消息(共 7 条)
2,494 次查看

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 项奖励
6 条消息(共 7 条)
2,438 次查看

@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 项奖励
7 条消息(共 7 条)
2,429 次查看