Variable Value Correction

Variable Value Correction

Hi Guys
I am facing a problem while communicating with Modbus. The issue is the Modbus slave is giving Junk Values suddenly (-65535 or 876728162876817). This is causing an issue when i aggregate it to 15 minutes average. Is there a way to correct the values coming from the Modbus Slave (eg. make it to 0 when some other values apart from the Limit value comes) or Neglect the junk value??? Is it possible to restrict it while storing in archive or while aggregating??? How to neglect it from mathematical variable if a junk value appears???

This is a migrated post! Originally posted on 26.03.2019 by user Praveen Kumar Karthikeyan. Please be aware that information can be outdated.