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

Day 309 of 365 · Expert · Month 11: Optimisation and debugging

All error codes

All 39 error codes of the chip with number and cause – and how a second chip reads Error and LineNumber of a housing.

Lesson 18 min Week 45

What you learn today

  • Read error numbers
  • Cause per code
  • Read the error at the housing

The heater in the lab stays cold. The housing says Error IncorrectLogicType at line 14. The game names the error and adds the line. Behind every name there is a fixed number, and the list is short enough to go through once completely.

While loading or while running

There are two moments when an error can happen:

  • While loading: before the chip starts, it reads every line. An unknown instruction, a missing operand or a duplicate label stop it before the first line runs.
  • While running: the line is valid, but something goes wrong when it runs, for example because no device is plugged into the pin. The chip stays on that line and retries it every tick.

The whole list

No.Nametypical cause
0Noneno error
1Unknownerror without its own number
2IncorrectVariableunknown name: typo in an alias, define or label
3IncorrectVariableTypenothing in the 0.2.6428 game code raises it, so it does not occur
4IncorrectLogicTypeLogicType misspelt or not readable/writable on the device
5IncorrectLogicSlotTypethe same for slot types
6IncorrectArgumentCountone operand too many or too few, e.g. batch mode forgotten
7DeviceNotSetpractically never: only an unused helper function throws it. An empty pin reports 25
8JumpTagDuplicatea label appears twice in the code
9UnrecognisedInstructionunknown instruction, also with wrong case
10IndexOutOfRangeindex outside the allowed range, e.g. a pin above d5
11OutOfRegisterBoundsregister above r17, usually via rr indirection
12OutOfDeviceBoundsthe same via dr indirection
13, 14, 15, 21IncorrectReagentMode, UnhandledReagentMode, IncorrectReagentDevice, IncorrectReagentTypearound lr: 14 unknown mode, 15 mode does not fit the device (Required on a furnace). The game code does not raise 13 and 21
16ChipCatchingFirehcf – the chip “catches fire”
17StackOverFlowpush beyond the 512 places
18StackUnderFlowpop or peek on an empty stack
19ExtraDefinethe same name defined twice
20DeviceListNullhousing not on any data network, batch instructions find nothing
22DeviceNotSlotWriteablethis slot must not be written
23, 24ShiftOverflow, ShiftUnderflownumber too big or too small for a bit instruction, bit position out of range
25DeviceNotFoundno device behind the operand: empty pin, unknown ReferenceId
26, 27MemoryNotReadable, MemoryNotWriteableget/put on a device without a matching memory
28, 29, 30InvalidStringLength, InvalidStringNull, InvalidStringNonAsciiSTR("…") too long, empty or with an umlaut
31, 32, 33InvalidPreprocessHash, InvalidProcessBinary, InvalidPreprocessHexHASH("…"), %… or $… unreadable
34LogicTypeIsNoneLogicType None used
35, 36PayloadOverflow, PayloadUnderflowbit field too long in ext/ins (35); the game code does not raise 36
37InvalidIntegersomething else where an integer belongs
38AliasNotFoundan alias points to nothing usable

In everyday play you mostly meet 4, 6, 9, 18, 20 and 25. The others are rare, but when they show up, you now know where to look.

Tip

The IC10 coder counts lines from 0, like the chip. If the housing says line 14, it is the line numbered 14 in the editor.

Seeing the error from outside

A second chip can watch every housing on the data network. It sees two values: Error is 1 while the housing has an error, otherwise 0. LineNumber is the line the chip is on right now. Because a chip with a runtime error stays on the faulty line, LineNumber is exactly the error line then.

define GEHAEUSE HASH("StructureCircuitHousing") # IC housing
lbn r0 GEHAEUSE HASH("Heizchip") Error Average      # 1 = error, 0 = running
lbn r1 GEHAEUSE HASH("Heizchip") LineNumber Average # current line
Warning

Error only says yes or no. You do not get the number or the name of the error over the data network, those only appear on the housing itself. And: give the watcher a different name than the chip it watches. Otherwise lbn averages over both housings.

Diagram

IC housing with chip, pins and data network IC housing IC10 db d0 d1 d2 d3 empty d4 empty d5 empty Gas sensor Wall light Display data cable Pump Battery Heater … data network: lb, lbn, sb, sbn
The housing reports an error with name and line. Over the data network another chip only sees Error (0 or 1) and LineNumber.

Exercise

Task

Build an error watch for the housing “Heizchip”: if it reports an error, the flashing light “Chipfehler” turns on and the display “Fehlerzeile” shows the line. Without an error the light is off and the display shows -1. If the housing is removed, that counts as an error: light on, display -1.

Hints

Hint 1

Read Error and LineNumber with lbn and the hash of StructureCircuitHousing.

Hint 2

If the housing is missing, Error is NaN. snan detects that, select turns it into a 1.

Hint 3

For the display use select twice: first by Error, then by the missing housing.

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