LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array of 15 elements: with every measurement delete first element and append actual value

Hi everybody,
 
I would like to analyze my measurements in realtime as I control a device with the results of the analysis.
Therefor I would like to continuously calculate the mean value of the last 15 values.
I know how to create the array of the first 15 elements, but how can I (after I got the first 15 values and calculated the first mean value of them) delete the first value and append the actual value with every following step? I tried it with the "Replace Array Subset", but it doesn't work the way I do it: (. Can I do all these steps within one while loop?
 
I think it's not that difficult, but I don't know any solution right now: ( I would really appreciate anybody's help or a simple example, I work with LV 8.0.
 
Thank you very much in advance.
Steffi
0 Kudos
Message 1 of 7
(3,879 Views)

Hi steffi,

you can use the "Rotate 1D Array" vi. See the attached example.

Mike

0 Kudos
Message 2 of 7
(3,876 Views)
This is just another method.
Vikas
0 Kudos
Message 3 of 7
(3,869 Views)
Steffi,

I posted a circular buffer example using queues on your other thread.

Lynn
0 Kudos
Message 4 of 7
(3,852 Views)
Yet another method. This uses one of the Point-by-Point functions (see attached images)
Download All
0 Kudos
Message 5 of 7
(3,843 Views)
Hi Steffi,

this will work without any shifting of elements in memory:



Message Edited by GerdW on 04-01-2008 05:59 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 7
(3,838 Views)
Wow, thanks to everybody.
I will have a closer look at your examples tomorrow!
Thank you very much!
0 Kudos
Message 7 of 7
(3,832 Views)