Discrete alarms and acknowledgement

The Core Idea

An alarm can remember that a warning occurred after the warning input changes. Acknowledgement records that the operator has seen it, while first-out information records which warning began the group.

What you will learn

  • Latch a brief warning so it stays visible after the input clears.

  • Keep acknowledgement separate from recovery: an alarm clears only after both have happened.

  • Show which of two warnings arrived first, even if the second alarm later clears first.

Why it matters

A useful alarm distinguishes an active condition, an event that still needs attention, and what happened first. Those meanings help an operator investigate the machine.

The problem

A small machine has two ordinary warning switches. TEMP_TRIP is TRUE while the temperature warning switch is active. PRESS_TRIP is TRUE while the pressure warning switch is active. ACK_PB is TRUE while the operator presses Acknowledge. There are no analog values in this example.

TEMP_ALARM and PRESS_ALARM must remember their respective warnings. Pressing Acknowledge records that the operator has seen each alarm already present. The alarm clears only when its warning input is FALSE and it has been acknowledged. FIRST_TEMP and FIRST_PRESS show which warning started the current alarm group. The first-out indication stays until both alarms clear. If both inputs arrive in one scan, this example gives temperature priority.

These signals are for indication and operator response. They do not command a machine stop or implement a safety circuit.

You will use the set/reset coil skill from Latch and Unlatch and the rising-edge skill from One-Shots and Edge Detection.

Predict

Start with both warnings FALSE. Turn TEMP_TRIP on, then off. Turn PRESS_TRIP on. Press Acknowledge while PRESS_TRIP remains on. Which alarm and first-out indications remain after the press?

Try it

  1. Turn on TEMP TRIP, then turn it off. Watch TEMP_ALARM remain TRUE.

  2. Turn on PRESS TRIP. Both alarms are TRUE, but FIRST_TEMP remains the only first-out indication.

  3. Press ACK (acknowledge) while pressure is still active. The recovered temperature alarm clears. The active pressure alarm stays on, and FIRST_TEMP still identifies the first warning in this group.

  4. Turn off PRESS TRIP. The acknowledged pressure alarm clears; with no alarms left, first-out clears too.

  5. Repeat with pressure first. The first-out indication should now be FIRST_PRESS.

Check your prediction

After the press, TEMP_ALARM is FALSE because its input has recovered and it was acknowledged. PRESS_ALARM is TRUE because its input remains active. FIRST_TEMP remains TRUE because the alarm group is still open. FIRST_PRESS remains FALSE.

Look closer

Follow one scan at a time. When a warning input first becomes TRUE, its set coil latches the corresponding alarm. When the input goes FALSE, that set rung goes inactive, but the alarm bit keeps its previous value. A fresh rising edge of ACK_PB latches a separate acknowledgement bit for each alarm that is currently present. A reset coil clears an alarm only when its warning is FALSE and its acknowledgement bit is TRUE. The acknowledgement bit then clears so it cannot apply to a later warning.

The first-out rungs run after the alarm set rungs. They capture the first active input only while neither first-out bit is set. While either alarm remains, the first-out bit keeps its history, even if that particular alarm has already cleared. Once both alarms clear, both first-out bits reset for the next group.

Change it

The practice program contains the working temperature and first-out logic, but the pressure reset and acknowledgement reset rungs are empty. Complete them, then compare these two orders: acknowledge before pressure recovers, and recover before acknowledging. Both orders should clear PRESS_ALARM only after both conditions have occurred.

Check yourself

Build the complete alarm program in the challenge editor, using the guided program as a reference. The challenge starts with an empty routine. Its behavioral check tests brief and held warnings, both arrival orders, acknowledgement before and after recovery, a held acknowledgement button, and a second alarm group. You can retry as often as you need.

Hint 1: What needs memory?

Each alarm, each alarm's acknowledgement, and the first-out indication need to keep their state across scans.

Hint 2: Where should reset conditions go?

Give each alarm a set rung from its warning input. Capture a fresh Acknowledge press for alarms already present. Reset an alarm when its warning input is FALSE and its acknowledgement bit is TRUE. Keep first-out until both alarms are FALSE.

Hint 3: How do you avoid reusing an old acknowledgement?

Use a rising-edge contact for ACK_PB, and reset each alarm's acknowledgement bit after that alarm clears. Put the two first-out set rungs in a stated priority order; each must require both first-out bits to be FALSE.

Show the worked solution

The complete program is available in the demo. For the missing pressure rungs:

  1. Put a normally closed contact for PRESS_TRIP in series with a normally open contact for PRESS_ACKED, followed by a reset coil for PRESS_ALARM. This clears only after recovery and acknowledgement.

  2. Put a normally closed contact for PRESS_ALARM before a reset coil for PRESS_ACKED. Once the alarm clears, its old acknowledgement is forgotten.

The temperature side follows the same pattern. The rising-edge contact on ACK_PB means a held button cannot acknowledge a warning that appears later. Release and press again to acknowledge that new alarm. The first-out reset rungs require both alarm bits to be FALSE, so the first cause remains visible while either alarm is still present.

What happened and why

An alarm has two pieces of memory here. The alarm bit remembers that its input tripped. Its acknowledgement bit remembers that the operator pressed the button while that alarm was present. Neither recovery alone nor acknowledgement alone is enough to clear the indication. First-out is a third piece of memory for the group: it records the earliest input and resets only when the whole group has ended.

This makes a short warning observable and lets an operator distinguish an initial cause from later warnings. It is an ordinary alarm display pattern; any actual stop, interlock, or safety requirement needs its own design.

Common mistakes

  • Cause: Use an ordinary output coil for an alarm. Symptom: a brief trip disappears on recovery. Fix: latch the alarm and reset it only after acknowledgement and recovery.

  • Cause: Reset on Acknowledge alone. Symptom: an active warning disappears while its input is still TRUE. Fix: include a normally closed contact for that warning input in the reset rung.

  • Cause: Reset when the warning clears, regardless of acknowledgement. Symptom: the operator can miss a short event. Fix: require that alarm's acknowledgement bit too.

  • Cause: Clear first-out as soon as the first alarm clears. Symptom: the first cause vanishes while another alarm remains. Fix: reset first-out only when both alarms are FALSE.

Enable JavaScript to run the embedded simulator and complete the interactive exercises.