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

Day 114 of 365 · Advanced · Month 4: Network in detail

Logic memory as a variable

A logic memory holds a value on the data network that players set without code. Several chips read it – guarded against NaN and typos.

Lesson 13 min Week 17

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:

Toolstep
screwdriver±1 or ±100, with the extra key held ±0.1 or ±10
labellertype 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
Warning

Replace NaN first, then limit. max and min with NaN give NaN again, so the limit does not catch the failure.

Tip

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

Devices on the data network with type and name IC housing IC10 StructureGasSensor „Lager“ StructureGasSensor „Werkstatt“ StructureWallHeater „Lagerheizung“ StructureWallHeater „Lagerheizung“ StructureWallHeater „Werkstattheizung“ lbn SENSOR HASH("Lager") reads only this sensor sbn HEATER HASH("Lagerheizung") switches both at once
One box, one value: players set Setting, every chip on the network reads it with lbn.

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

Esc
↑ ↓ selectEnter open/ opens search anywhere