ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

averaging in the loop

Hi all.  I would like to average 2D arrays whilst running the measurement. I attachhed the VI below, in which i receive data from 2 instruments and plotting them into a XY graph with history. What i want to do is averaging graphs every 200th sampling and plot it.

 

to make it clear:

 i start the measurement and collect 200 x and y datas lets call sample 1

as running the loop another 200 x and y datas (201th-401th datas) called sample2

 

and average them  ((1th+201th)/2, (2th+ 202th)/2,... and plotting.

 

when i get the another 200 x,y  datas ( 402th-602th  datas) called sample 3, i want to average

those with previous ones ( 1th+201th+402th)/3, (2th+202th+403th)/3

 

and keep doing this process till i stop the measurment.

 

I am a bit confused how to start with algohrithm. any hellp is appreciated

 

thanks

 

 

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

Slow down! 

First of all, lets assume you specify a resource (which you aren't), are you getting the data you want in the atttached VI by reading the VISA resource as opposed to the reading the read buffer????

Richard






0 Kudos
Message 2 of 7
(3,627 Views)
yes , I have 2 visa resources ( Multimeters ).
0 Kudos
Message 3 of 7
(3,622 Views)
...and you are getting data from the multimeters the way the VI is wired?
Richard






0 Kudos
Message 4 of 7
(3,613 Views)
yes it works fine. isnt it correct?
0 Kudos
Message 5 of 7
(3,610 Views)
i didnt show the resource name wirings, which are thee gpib adresses
0 Kudos
Message 6 of 7
(3,608 Views)

The missing resource was one thing. I was more surprised at the fact that you wired the resource into the string>number function, so your data IS the resource. Interesting.

 

Anyway, sorry if it seems I hijacked your thread with an urelated question.

Attached is a VI (saved to 8.5) that will hopefully give you some ideas on how to build the three samples of 200. I didn't quite understand your averaging, so I guessed at it.

 

 

 

Richard






0 Kudos
Message 7 of 7
(3,555 Views)