← All exercises

Level Alarm

medium

Generates high and low alarms based on a level input, configurable setpoints, and a deadband to prevent chatter.

What it teaches

Two independent latched alarms, one on each side of the process. The Hi alarm raises at its setpoint and only clears once the level falls a deadband below it; the Lo alarm mirrors that, clearing once the level rises a deadband above. That gap is what stops a level parked on a setpoint from reporting over and over.

Inputs and outputs

TagTypeDefaultDescription
In_LevelREAL50Process variable level
Cfg_HiSPREAL80High alarm setpoint
Cfg_LoSPREAL20Low alarm setpoint
Cfg_DeadbandREAL5Deadband applied to clearing alarms
Sts_HiAlarmBOOLHigh alarm flag
Sts_LoAlarmBOOLLow alarm flag

Required behavior