What you learn today
- All systems on one board
- Priorities
- Readability
Whoever comes into the base in the morning wants to know within two seconds: is everything fine? And if not – what first? An overview panel answers both if it is built by two rules: priorities and readability.
One status per subsystem
Every subsystem reports a single number via a Logic Memory:
| Value | Meaning | Colour |
|---|---|---|
| 0 | fine | green |
| 1 | warning, but running | yellow |
| 2 | fault | red |
A missing memory counts as a fault. Whoever does not report cannot be fine either.
Priorities
Not every fault is equally bad. The workshop orders like this: 1 life support, 2 power, 3 production, 4 logistics. The overall display shows the number of the system with the worst status – and on a tie the more important one. For that the chip reads the systems from the least important to the most important and takes over a system even with an equal status:
sge tmp s worst # equally bad counts too
select wer tmp nr wer
max worst worst s
Because life support comes last, it wins every tie. If the panel shows “1” in red, the air is in danger, no matter what else is red.
Readability
- Colour first. You see the colour from five metres, the number only from one.
- One display per system, one for everything. More numbers do not make the panel any smarter.
- Fixed place. Life support always hangs top left. Whoever knows the panel does not need to read where things are.
- Eye level. The panel hangs where you pass anyway, not above the door.
A small subroutine computes the colour for the status. Because it is called from inside another subroutine, the caller saves ra first – otherwise the first return would no longer find its way home.
Exercise
Task
Build the overview panel. Four Logic Memories “LS_Status”, “EN_Status”, “PR_Status”, “LG_Status” report 0, 1 or 2 – a missing memory counts as 2. The displays “Ueb_LS”, “Ueb_EN”, “Ueb_PR”, “Ueb_LG” show the status as number and colour (green, yellow, red). “Ueb_Basis” shows the number of the worst system (1 LS, 2 EN, 3 PR, 4 LG, on a tie the more important one) in its colour, or 0 in green if everything is fine.
Hints
Hint 1
A subroutine zeigen with name, display and number in registers, called four times – LG first, LS last.
Hint 2
In the subroutine: sge tmp s worst, select wer tmp nr wer, max worst worst s.
Hint 3
Colour: sgt colour s 1, select colour colour ROT GELB, select colour s colour GRUEN.
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