What you learn today
- What belongs to a data network
- Devices on separate networks
- Cables, bridges and failure patterns
You named the heater in the new wing properly, the name is right, the prefab is right – and sbn still switches nothing. Then the culprit is usually not the code but the cable.
What a data network is
All cables connected to each other form one network. Normal, heavy and super-heavy cable all carry power and data. A device belongs to a network when its data port hangs on one of those cables.
- Some devices have one shared port for power and data: wall light, LED display, volume pump.
- Others have separate ports: the IC housing has a data port and a power port, the station battery one data port and two power ports.
- Gas sensor, lever and button only have a data port.
Devices do not join networks
A device with two cable ports does not turn two networks into one. That mainly concerns transformer, area power control and batteries: they pass power from one network to the other, but they remain two networks. On the small transformer only the input carries data, the output only power.
For the chip that means: everything behind a transformer is a different network – and therefore invisible.
What the chip sees then
| Situation | Pin | lbn with Average | sbn | lb … Count |
|---|---|---|---|---|
| device on its own network | can be assigned | value | writes | counted |
| device on another network | cannot be assigned | NaN | writes nothing | not counted |
| housing without data cable | – | error DeviceListNull, chip stops | error | error |
Failure patterns in the game
- A piece of cable was removed or has burnt out: the network falls apart into two halves. Suddenly devices are missing that were there yesterday.
- A new device sits behind a transformer: it never appears on the chip's network.
- Two networks that look the same: cables run side by side but are not connected.
Checking in code
With lb and Count you ask how many devices of a type the chip sees. If you know how many there should be, you spot a network fault right away:
define SENSOR HASH("StructureGasSensor") # Gas Sensor
define EXPECTED 3 # sensors on the network
alias count r0
alias fault r1
lb count SENSOR Temperature Count
slt fault count EXPECTED # 1 = one is missing
Count with lbn ignores the name and counts all devices of the type. For counting, use lb.
For “device does not react”: first follow the cable from the device to the housing, then check the name, the code last.
Diagram
Exercise
Task
A network check: three gas sensors should be on the network. There is also an LED display “Sensoren” and a flashing light “Netzfehler”.
- The display shows how many gas sensors the chip sees (
lbwithCount). - If it sees fewer than 3, the light flashes.
Hints
Hint 1
lb count SENSOR Temperature Count counts the sensors.
Hint 2
slt fault count EXPECTED is 1 when one is missing.
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