I have a tag that measures the number of hours a piece of machinery has been operated for. Unfortunately, the sensor is returning erroneous values that are causing problems in our reporting. I'm hoping that there's a way within DataLink to remove these values. Here's what the data I'm looking at now:
And I'd like it to return this:
Now, I know that I could simply apply a filter expression that would eliminate negative values, or even one that eliminates values that are less than the previous one. The problem is that there's instances like this:
Where you have a value (3770.251) greater than the previous one, but one which is inaccurate. I have thought about setting a max/min type filter, but I'm concerned that over time the upper limit would have to be increased so that valid values above the threshold aren't eliminated. My thought would be to do something that would filter out the next value if it isn't within 0.50 and greater than the previous value, but I'm not sure how to do that or if that's even the best option (or, indeed, if it's possible). So far I have: PrevVal('tag_name','*') < 'tag_name'. This solves the negative values issue, but doesn't solve the spike in value issue.
We're working to rectify the sensor problem, but in the meantime we'd like to use DataLink as a way to filter out these bad values.
Thank you very much in advance for any help you can provide.