What you learn today
- Store values on the network
- Read from several chips
- Settings for players
The target temperature sits in the chip as a define. Whoever wants to change it has to open the code. That is too much to ask of fellow players. A logic memory (StructureLogicMemory) is a small box with exactly one value that anyone in the game can set.
One value on the network
The logic memory has only one LogicType of its own: Setting, readable and writable. It needs no power.
lbn target MEMORY HASH("Solltemp") Setting Average
Every chip on the same data network can read it. Two heating chips in two rooms fetch the same setpoint that way. If someone changes it, both follow.
Settings for players
In the game code there are two ways to change the value by hand:
| Tool | step |
|---|---|
| screwdriver | ±1 or ±100, with the extra key held ±0.1 or ±10 |
| labeller | type the value in directly |
For a setpoint in °C that is ideal: enter 21, done. The chip converts to Kelvin.
Keeping it plausible
A fellow player can make a typo. 210 instead of 21, and your greenhouse boils. So limit every value that comes from outside:
max target target SETMIN # never below 5 C
min target target SETMAX # never above 35 C
If the logic memory is missing altogether, Average returns NaN. Then you take a fixed fallback value:
snan missing target
select target missing FALLBACK target
Replace NaN first, then limit. max and min with NaN give NaN again, so the limit does not catch the failure.
Give the logic memory a name that tells meaning and unit, such as “Solltemp” for a value in °C. Then everyone knows what they are setting there.
Diagram
Exercise
Task
The workshop heater fetches its setpoint in °C from the logic memory “Solltemp”.
- Limit the setpoint to 5 to 35 °C. If the logic memory is missing: 20 °C.
- LED “Sollwert” shows the setpoint in °C the chip really works with.
- Heater “Werkstatt”: on below setpoint − 1 K, off from setpoint + 1 K, keep the state in between. Gas sensor “Werkstatt”, heater off on failure.
Hints
Hint 1
Order: read, replace NaN with FALLBACK, limit with max and min, display, then convert to Kelvin.
Hint 2
The hysteresis needs two limits: target + BAND and target − BAND.
Hint 3
Gas sensor and heater are both called “Werkstatt” – the type tells them apart.
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