1. Create a 10-second timer.
2. Establish a memory storage area with 120 locations, probably in "F8" floating-point type memory, F8:1 to F8:120.
3. Create logic to shift the array every 10 seconds, #120 disappears, #119 moves to 120, #118 moves to #119...and so on until #1 moves to #2. Now put the latest new reading into #1.
4. Now, every 10 seconds, add all 120 memory storage locations together and divide by the Sample Count (normally 120). There is a short-cut: you can just subtract #120 from a Total Value, and add in the new value, save to Total Value. Then divide the new Total Value by the Sample Count to get the moving average.
5. Store the new moving-average in F8:0.
You will probably need some logic to wait until you have the first 120 samples, before you establish the average. Depending on the process, you may be able to calculate and use the moving average on the way up to 120 samples. Make sure that your Total Value will not ever exceed the maximum allowed value of the memory registers (3.40282347e+38 for the F8 Floating Point locations).