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

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

Logic devices without a chip

Logic reader, writer, compare and math build simple rules without code. A chip can read their results – and takes over as soon as things get complicated.

Lesson 13 min Week 17

What you learn today

  • Logic reader, writer, compare and math
  • When a chip is better
  • Combining both

Not every control needs a chip. The game has a whole family of small logic devices that you set up with the screwdriver. They read a value, compare, calculate and write, without a single line of code.

The four most important

DevicePrefabdoesresult in
Logic ReaderStructureLogicReaderreads a LogicType of a chosen deviceSetting
Logic WriterStructureLogicWriterwrites the value of its input into a targetat the target
Logic CompareStructureLogicComparecompares two inputs: Equals, Greater, Less, NotEqualsSetting (0/1)
Logic MathStructureLogicMathcalculates with two inputs: Add, Subtract, Multiply, Divide, Mod, Atan2, Pow, LogSetting

Compare and math work with the Setting of their input devices. A chain looks something like this: a reader reads the room temperature, a logic memory holds the setpoint, a compare checks “less”, a writer switches the heater. Which device and which value a reader reads is set with the screwdriver. According to the game data each of these four devices draws 10 W.

When a chip is better

Logic devices are good for one single, simple rule that everyone in the room should see and understand. As soon as more comes along, the chip wins:

Tasklogic deviceschip
one comparison, one actiongoodworks too
hysteresis with memoryclumsyfour lines
sensor missing, safe statehardly possiblesnan, bdns
timers, sequencesnoyes
many devices by namenolbn, sbn

A detail from the game code: Equals and NotEquals in the logic compare compare with a small tolerance, not exactly like seq.

Three traps from the game code

  • Reader without a target: if the device a logic reader reads is removed, it reports Error 1 – but its Setting keeps the last value. A chip that only reads Setting notices nothing and keeps calculating with an old value. So read Error as well.
  • Writer only writes on change: a logic writer only writes again when its input or its target changes. If someone has changed the target by hand in the meantime, it stays that way. With ForceWrite 1 you force it to write again on the next tick.
  • Batch reader needs an output: the logic batch reader only works when a data cable hangs on its output as well. Otherwise it reports Error 1.

Combining both

The chip can read any logic device like any other device. The Setting of a compare is then 0 or 1, that of a math device a calculation result:

lbn night COMPARE HASH("Nacht") Setting Average
lbn total MATH HASH("Summe") Setting Average

That way a chain that already exists feeds a chip. Or a chip puts a setpoint into a logic memory, and a simple chain at the other end of the base evaluates it.

Warning

Logic devices need power and can be removed like any device. Guard values from a chain just like sensor values: if the device is missing, lbn … Average returns NaN.

Tip

Start with a chip right away if you already know that “just one small thing” will be added later. Rebuilding is more work than building it right in the first place.

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
Every logic device stores its result in Setting. To the chip it is a device like any other.

Exercise

Task

Kolja has already built a logic chain. A logic compare “Nacht” reports 1 when it is dark, a logic math “Summe” adds up the power of two solar fields. Your chip reads both:

  • Wall lights “Hoflicht” follow the compare. If the compare is missing: light on.
  • LED “Leistung” shows the Setting of the math device. If the device is missing: −999.

Hints

Hint 1

Both results sit in the Setting of the logic devices.

Hint 2

Light: snan, sgtz, then or with the failure.

Hint 3

Display: select total missing NOVALUE total.

Quiz

5 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