SMM
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Gallery
Events
Blogs
Downloads
Articles
Media Demo
Posts posted by SMM
-
-
I am having a problem of figuring out a way to calculate an average for variable number of varables.
That is, I receive new values to V350 once per second and I want to be able to change the averaging period without having to download new program to OPLC all the time.
The Filter FB is not suitable because it has only 16 values max and the number of valuables is a constant inside the FB and cant be changed.
The Vector Shift and Vector Store FB combination wont work for the same reason, the vector length is a fixed constant value.
If anyone has done something like that before or has any ideas - I would be happy to hear them.
Moving average
in Vision & Samba PLC + HMI Controllers & VisiLogic Software
Posted
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.