Analog Alarms and Hysteresis
The Core Idea
Hysteresis gives an alarm different thresholds for turning on and turning off. The gap between them lets the alarm keep its state near a limit instead of switching with every small measurement change.
What You Will Learn
Why a single alarm threshold can chatter when a measurement fluctuates
How separate trip and reset limits create hysteresis
Why the same measurement can correctly produce different alarm states
How to implement and test that memory in Ladder or Structured Text
Why it matters
A useful alarm draws attention to a process condition without repeatedly distracting the operator as a reading moves around a threshold.
Shared foundation · Ladder and Structured Text implementations included
Meet the Problem
A tank has a high-level alarm at 80%. Its transmitter reports 79.8%, 80.2%, 79.9%, then 80.1%. A single-threshold alarm turns off, on, off, then on. The repeated switching is called chatter. It makes the alarm distracting even though the measured level has barely changed.
Give the alarm two limits: turn it on at or above 80%, but do not clear it until the level reaches 75% or below. Between the limits, remember its previous state. That separation is hysteresis.
This lesson is about an automatically clearing indication. It does not command a pump or a shutdown. Acknowledgement, shutdown latches, and operator resets are separate requirements.
Predict Before You Run
The alarm starts OFF at 74%. It rises to 78%, then 81%, then returns to 78%. Should the alarm be the same at both visits to 78%?
Hold that prediction while you try the experiment. The Concept view shows the process and alarms; the Ladder and Structured Text views show their implementations. Changing views keeps the current measurement and alarm state.
What to Try
Reset the experiment, then select Set 78%. The alarm with hysteresis stays OFF because it has not crossed the trip limit.
Select Set 80%, then Set 78%. The single-threshold alarm clears at 78%, but the alarm with hysteresis stays ON. It remembers crossing 80%.
Select Set 75%, then Set 78%. The alarm clears at exactly 75% and stays OFF at 78%. It must reach 80% again to trip.
Replay noisy readings. Follow the history below the controls. The single-threshold alarm follows each crossing; the other stays ON until 75%.
Switch language views. Both use the same tags and boundary rules. The measurement is unchanged by either alarm decision.
The Rule, Independent of Language
| Measured level | Alarm action |
| At or above 80% | Turn ON |
| Above 75% and below 80% | Keep its previous state |
| At or below 75% | Turn OFF |
The band is 5 percentage points wide: 80 minus 75. A wider band requires more recovery before the alarm clears. A very narrow band may still chatter if the fluctuations cross both limits. Select limits that suit the process.
Hysteresis changes the decision. A filter changes the measurement used by the decision and can add delay. They solve related problems in different ways.
Starting Inside the Band
At startup, a measurement of 78% does not tell you the previous alarm state. This experiment deliberately initializes the alarm OFF. Reset experiment returns to 74% with both alarms OFF. A real application's startup and retained-memory policy must be specified; the band alone cannot decide it.
Inputs and Outputs
| Tag | Type | Meaning |
| LEVEL_PCT | REAL | Measured level in percent |
| TRIP_SP | REAL | Upper trip limit; 80% in the experiment |
| RESET_SP | REAL | Lower clearing limit; 75% in the experiment |
| SINGLE_HIGH | BOOL | Comparison alarm with one threshold |
| LEVEL_HIGH | BOOL | Alarm that remembers its state between the limits |
Always keep RESET_SP below TRIP_SP for this lesson's high-level alarm. The practice checks also use 60% and 55%, so use the setpoint tags in your logic. Setting limits and validating operator entries is a separate lesson.
Two Implementations of the Same Rule
Ladder: a greater-than-or-equal comparison (GE) against TRIP_SP drives a set
coil for LEVEL_HIGH. A less-than-or-equal comparison (LE) against RESET_SP drives
a reset coil for that same tag.
When neither rung is true, the stored alarm state remains unchanged.
Structured Text: one IF sets LEVEL_HIGH to TRUE at the upper limit. A second IF sets it to FALSE at the lower limit. Between them, neither IF assigns a new value, so the tag keeps its state across scans.
Both implementations evaluate the clearing rule after the trip rule. With properly ordered limits they cannot both be true. That order does not make invalid or reversed setpoints acceptable.
Check Your Understanding
Predict the sequence to check the shared concept. You can also open either programming exercise to build it yourself. Each successful check earns the same single lesson star; Mark complete is available without passing a check.
Common Mistakes
Clearing the alarm whenever the upper comparison becomes false. That recreates the original one-threshold alarm. In Ladder, an output coil driven only by the trip comparison clears every time that rung is false. In Structured Text (ST), an ELSE that clears the alarm below 80% loses the intended memory.
Forgetting the equality cases. The specification says “at or above” and “at or below.” Test exactly 80% and exactly 75%, as well as values on each side.
Checking only one value at a time. The alarm at 78% depends on its history. Test approaching it from below and returning to it after a trip. Include a second full cycle to confirm it can clear and trip again.
Calling acknowledgement a reset. Acknowledgement records that an operator has seen an alarm. This exercise clears the active alarm when the process reaches the lower limit; it has no acknowledgement button. A separate latched shutdown would need its own rules.
Worked Ladder Solution
Show the rungs and why they work
GELEVEL_PCT against TRIP_SP → output coil SINGLE_HIGH, the comparison alarm.GELEVEL_PCT against TRIP_SP → set coil LEVEL_HIGH, remembering the trip.LELEVEL_PCT against RESET_SP → reset coil LEVEL_HIGH, clearing after recovery.
The Ladder view of the live experiment shows these running rungs. The ST practice has its own expandable worked solution. At 78%, neither the set nor the reset rung changes LEVEL_HIGH, which is the memory the exercise needs.
Key Takeaways
Hysteresis uses separate trip and clearing limits.
Inside the band, the previous state determines the current state.
Test both boundaries, both directions, and repeated cycles.
Hysteresis does not filter the measurement or acknowledge an alarm.
The same control concept can be implemented in Ladder or Structured Text.
Enable JavaScript to run the embedded simulator and complete the interactive exercises.