Filtering tag data

I have a device (vibrating wire peiziometer). It is read 4-20ma into a PLC.

I read the values from the PLC and historize the data for reports and trending.

I have one problem though. Sometimes when I read the device it is in the middle of it’s update and the 4-20ma is at 4ma (zero) so I have spurios data being logged.

Is there a good way to filter based on rate of change so only good data is logged. Or do I have to do this within the PLC code.

It will be easiest to do it in the PLC. However, you can create an expression tag that gives you the correct value based on some logic. The expression would be something like this:if({[~]ValueFromPLC} = 0, {[~]ExpressionTag}, {[~]ValueFromPLC})It would return the last value of the tag if the PLC value equals 0 otherwise it will give you the latest value in the PLC. It would remove the go to 0 condition.