AC 800M Analog input sampling
I want to take an average value for an analog input for a period of 30 mins.
Is any standard block available for this?
FIFO Queue , sum the values and divide by the number of valuies in the queue. Make sure you trap a divide by zero error.
However, for most purposes an "average" is too heavily weighted in favour of old data. The first value in the queue has the same importance as the latest value, so it is totally useless at detecting rapid changes.
If all you're trying to do is remove noise, then use a first order filter. To filter 30 mins of data, divide the time by 4 to get 7.5 minutes. New values have a high influence on the filtered result. Values more than 4 * the Lag time basically have no influence at all.