This should work for both setpoint and measure. Just set hysteresis value big enought if needed.
value_plus_hyst:= saved_value + hysteresis
value_minus_hyst:= saved_value - hysteresis
input_changed:=0; //oneshot bit
if input > value_plus_hyst
then
saved_value:= input;
input_changed:=1;
end_if;
if input < value_minus_hyst
then
saved_value:= input;
input_changed:=1;
end_if;
Yes, but not relevant if it is the set-point change that needs to be recorded...
We have to wait for the OP's response...