LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Collecting samples of data for analysis

I’m afraid I am quite new to labview so excuse the simple line of questioning. I am receiving values from a plc and I am looking to collect two different samples of data for analysis:

  1. I would like to collect 40 values and once collected, rotate the sample so the oldest value is replaced by the new one, but maintaining an array of 40 values. This is to calculate the rolling average of the latest 40 values for the duration of the while loop.
  2. Secondly, I would like calculate the average of all values collected for the duration of the while loop. This means the sample will keep growing for the duration of the while loop and I will need an array of increasing size to be analysed.

I know the array functions can do this, however I am unable to figure out how. Any assistance or examples to help achieve this would be greatly appreciated.

Best regards,

Stuart Wilson

0 Kudos
Message 1 of 4
(2,483 Views)

Here is a quick (and dirty) way. I know that there are more elegant ways, can't look at them at the moment, but this may give you ideas.

P.M.

 

LabVIEW 7.0

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 4
(2,474 Views)
Hi,
 
Just today  i seen your message when i browsing Ni discussion forms for some other information.I am sure it is very late reply , but i would like to share my code for your running average.Please find the attachment.
 
Thanks
G.Gopalakrishnan,Senior project Engineer,India.
0 Kudos
Message 3 of 4
(2,402 Views)
a clean and elegant way Smiley Wink Smiley Very Happy
 

Message Edited by devchander on 05-12-2006 07:16 AM

0 Kudos
Message 4 of 4
(2,392 Views)