IO-AI4-AO2 doesn't have filtering, at least not a setting for one in the setup. Also, the signals I am filtering are very erratic, I am trying to get an approximate level, we call it density level, in a tank full of fluid with a large amount of gas being pumped into the bottom. A filter that uses reading over a couple seconds works best. Here is what I use :
Usable value (UV), Current value (CV)
UV = 0.95*UV + 0.05*CV
The coefficients can be changed they just need to add to 1. This needs to be executed on regular intervals.
I was able to get the code working. Once I used the 'Stop - Download - Run' button instead the 'Download' button things started working more predictable.
Learing is sometimes painful.