Hello Michael,
thanks for the input! However, I think I cant adapt this example to my program as it does reset all data after some period, and I need to show average value for the last n values at all times (I should have mentioned that in the first post, sorry).
I think I have actually found a solution by creating a sort of FIFO vector so I can um up all values in the vector irregardles of its length. It turned out that You actually can set vector length via a MI, I am yet to test this solution, but I believe it should work.