stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 137

Day 137 of 365 · Advanced · Month 5: Memory and structure

Fault and acknowledge

A fault stays until someone acknowledges it – and that only works once the cause is gone. A number on the display tells what happened.

Lesson 15 min Week 20

What you learn today

  • Latch the fault state
  • Acknowledge with a button
  • Show the cause

The wall heater in the lab holds 18 to 20 °C. One morning the sensor shows 40 °C – the furnace next door has heated up the room, maybe something is even burning. The heater switches off. An hour later it is cool again and the heater starts as if nothing had happened. Nobody noticed anything, until it happens the next time.

Real heating systems have a safety temperature limiter for this: it switches off and stays off until someone resets it by hand. That is exactly what you build today.

Latching the fault

A register cause records what happened. 0 means “no fault”, every other number is a reason:

CauseMeaning
0all fine
1overheating above 35 °C
2sensor missing

Every tick the chip works out whether there is a reason right now. A new cause is only taken over if none is stored yet:

move now 0
sgt tmp temp MAXTEMP
select now tmp HOT now               # 1 = too hot
snan tmp temp
select now tmp NOSENSOR now          # 2 = sensor missing
select cause cause cause now         # first cause stays

The last line is the latch: if cause already holds something, it stays, otherwise now goes in. When the temperature drops again, now becomes 0 – but cause does not.

Acknowledging with a button

Only a button may clear the fault, and only when there is no reason any more:

seqz tmp now            # cause gone?
and tmp tmp pressed     # ... and button pressed?
select cause tmp 0 cause

If it is still too hot, pressing does nothing. That way nobody can push away a fault whose reason still exists.

Showing the cause

The heater only runs without a fault, a flashing light makes it visible, and an LED display names the number:

seqz clear cause        # 1 = no fault
and tmp heat clear
sbn HEATER HASH("Heizung") On tmp
snez tmp cause
sbn LIGHT HASH("Stoerung") On tmp
sbn DISPLAY HASH("Ursache") Setting cause

The hysteresis in heat keeps calculating undisturbed. After acknowledging, the heater carries on exactly where the temperature is right now.

Warning

Acknowledge with a button, not with a lever. If a lever is left “on”, the acknowledgement is permanently true: every fault clears itself as soon as the cause is gone, and the latch is useless.

Tip

Stick with the first cause. If the sensor also fails after the overheating, the display keeps showing 1. The first message leads to the actual problem, the later ones are often just consequences of it.

Exercise

Task

The lab heater gets a safety cut-out. Devices: gas sensor “Labor”, wall heater “Heizung”, flashing light “Stoerung”, LED display “Ursache”, button “Quittieren”.

  • Above 35 °C: fault with cause 1. Sensor gone: cause 2.
  • The first cause stays stored even when the reason disappears.
  • The button clears the fault, but only when there is no reason right now.
  • During a fault the heater is off and the flashing light on. The display shows the cause (0 = none).

The 18–20 °C hysteresis is already done.

Hints

Hint 1

now starts at 0 every tick: move now 0, then enter the cause with sgt and snan and one select each.

Hint 2

Latch: select cause cause cause now – only an empty cause gets filled.

Hint 3

Acknowledge: seqz tmp now, and tmp tmp pressed, select cause tmp 0 cause.

Hint 4

Heater: seqz clear cause and and tmp heat clear. Flashing light: snez tmp cause.

Quiz

4 questions. You pass from 60 % – the server does the grading.

Complete the day

  • Passed the simulator exercise
  • Passed the quiz with at least 60 %

Without an account progress is saved in this browser only.

Report a mistake in this lesson

Please sign in to report. Sign in

Esc
↑ ↓ selectEnter open/ opens search anywhere