How does the ABS work in the code
abs works as it normally does , read the pbp manual for a detailed explanation


I assume hysteresis is a constant !
only if you want it to be

I would like to add some hysteresis around the process signal
I'm assuming by your initial question that by hysteresis you mean ; set point plus or minus a small amount .
therefore a trigger event occurs when the reading is outside the (setpoint -+ hysteresis) range

there are many more possibilities