Is there a way to “latch” a value being written to the database, or use the previous historical value as the “else” part of an if/then/else?
My specific issue is an machine error code value which is zero during normal running conditions. When a non zero error code is present (and the machine stops), I want to maintain this error code value in the tag history even after the error code has been reset to zero. The tag would only reset to zero when the machine restarts, or some other condition that I choose.
Trying to maintain the previous value with an if/then/else creates a circular reference that it doesn’t like. Any suggestions?