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:
| Error | Cause |
|---|---|
UnrecognisedInstruction | typo in the instruction, wrong case, label not alone on its line |
IncorrectArgumentCount | operand forgotten – e.g. the batch mode on lbn |
IncorrectLogicType | LogicType misspelt or the device does not support it |
DeviceNotFound | no device on the pin or device not on the same data network |
IncorrectVariable | a 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,5is 15. - Celsius instead of Kelvin: 20 instead of 293.15 – the heater never runs.
Suminstead ofAverage: only shows with the second sensor.- NaN: sensor gone, name wrong – all comparisons turn false.
- Label in a relative jump:
jr startjumps 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.
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
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?