Measurement validation for process signals

Struggling with implementing a validation routine for process measurements. We'd like limit violation, high rate-of-change (ROC) and measurement freeze
detection. Option for shedding to bad value or holding last good for all the tests, individually switchable. Ramped recovery on clearing of all violations.
All control engineers must have wrestled with this at least once in their careers. Is there any standard flowchart or pseudocode around that anyone can post? I can do it, but developing the state behaviour with all the possible options is overheating my (old) brain.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
Add image file
Upload is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.