We are currently experiencing issues with email delivery; this is being resolved as quickly as possible.

stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Debugging and common traps

Chapter 7 · Pro

Debugging and common traps

Limits, silent errors and the classics everyone gets stuck on once.

Lesson 17 of 18 12 min

A chip that does not do what it should rarely tells you why. This list saves hours.

Loud errors

The housing shows an error code and the line. The most common ones:

ErrorCause
UnrecognisedInstructiontypo in the instruction, wrong case, label not alone on its line
IncorrectArgumentCountoperand forgotten – e.g. the batch mode on lbn
IncorrectLogicTypeLogicType misspelt or the device does not support it
DeviceNotFoundno device on the pin or device not on the same data network
IncorrectVariablea name the chip does not know (alias/define/label)

On a runtime error the chip stays on that line and retries it every tick.

Silent errors – the nasty ones

  • Program end without a loop: the chip stops forever, no error.
  • 1e5: not a number. A define using it silently becomes NaN.
  • Comma instead of dot: 1,5 is 15.
  • Celsius instead of Kelvin: 20 instead of 293.15 – the heater never runs.
  • Sum instead of Average: only shows with the second sensor.
  • NaN: sensor gone, name wrong – all comparisons turn false.
  • Label in a relative jump: jr start jumps somewhere random.

Tools

The checker in the IC10 coder finds most traps while you type: red waves for errors, yellow for warnings. In the simulator you can watch with breakpoints and single steps which line does what, and change sensor values by hand.

Tip

Narrow it down: write the value you do not trust to a display, or with s db Setting r0 onto the housing. What the chip really sees is often surprising.

Diagram

The three limits of a program Lines 74/128 Characters 3990/4096 Width 97/90 Comments and blank lines count fully. The longest line here is too wide.
Three limits at once: 128 lines, 4096 characters, 90 characters per line. With long comments the character limit usually breaks first.

Exercise

Task

This chip should switch on the wall heater “Heizung” when the room is colder than 20 °C – measured by two gas sensors both named “Raum”. The code contains six bugs. Find and fix them. The checker below the editor helps with some of them – but not all.

Hints

Hint 1

The checker marks three bugs in red: exponent notation, case of the LogicType and of the instruction.

Hint 2

Two sensors with the same name – which batch mode suits a temperature?

Hint 3

What happens when the chip reaches the bottom? And how often per tick should it measure?

Esc
↑ ↓ selectEnter open/ opens search anywhere