Open pldroit opened 3 years ago
Thank you @pldroit for the notification. We looked into it, and your initial guess about the problem cause seems right.
To better solve the issue, could you please tell use what is your use-case for using the function with DWORD
instead of REAL
?
Hi, many fieldbus systems don't support REAL
types. It's common to sent values as integer types like DINT
with a defined scale and unit (eg. 3 decimal places and volt).
If you want to filter this input data to reduce noise, you would use this function.
@LZimmermannLZI This is also interesting for the unit tests initial runs
Hi @Maghnie, did you solve the problem and can we close this issue?
Thanks @StGoebel for the reminder!
Unfortunately, we didn't get to solve this bug when we looked into it the first time. And the person who was working on this issue already left the team.
I did a little memory-refreshing now, and it appears that there was a similar bug in the WORD variant of this moving average function. However, it had been solved:
For the next step, I'd suggest testing if the fix from FILTER_MAV_W
works in this function as well. I could do that, but I'd have to set up my Twincat environment again, so that might get scheduled until after a couple of weeks.
What is the issue/what feature do you want to develop?
FILTER_MAV_DW calculates wrong moving average values when input value decreases
here a small example run with codesys 3.5 SP17
What are the requirements?
How do we want to solve it?