What you learn today
- Breakpoints and single step
- Set values by hand
- Couplings for trends
Testing a chip in the game is tedious. You cannot simply set a sensor to 5 °C, and if something goes wrong, the room is already cold. The simulator in the IC10 coder plays all of that through in the browser.
Step, tick and breakpoint
| Button | does |
|---|---|
| Step | run exactly one instruction |
| Tick | run a whole tick, up to the next yield |
| Run / Pause | keep running, the speed is adjustable |
| Reset | reload the chip, everything back to the start |
A breakpoint stops the run at a line. You set it with a click on the line number. Then the register list shows exactly what is in every register before that line. With Step you continue from there instruction by instruction. The tick display tells you which line the chip is on and how many of the 128 instructions the tick has used.
Setting values by hand
Under Devices you create what your chip expects: “Add to network” for lbn and sbn, “Insert device” for a pin. Every device gets a name as in the game and values you can change at any time. That way you try every case: cold, warm, exactly on the limit. Remove takes a device away, that is your failure test.
Strict mode only allows LogicTypes that are listed on the device, as with real devices. That helps you find mistyped names.
Couplings for trends
A real pump fills a tank. In the simulator a coupling does that: every tick factor × source is added to the target.
| Source | Target | Factor | Effect |
|---|---|---|---|
| Pump.On | Tank.Pressure | 50 | 50 kPa more per tick while the pump runs |
On top of that every value has a Δ/tick, a fixed change per tick. −10 on the pressure lets the tank slowly drain. Together you see whether your hysteresis swings the way it should. The chart button next to a register records the curve in the Trend.
sgt edge pumping last # pump just started?
add starts starts edge # count switching cycles
move last pumping
How often a pump starts is a good measure. If it switches every few ticks in the trend, your band is too narrow.
The simulator starts every run with zeros in all registers. In the game the chip keeps its old values. So check that your code also starts correctly without these zeros, thanks to the lines before the start label.
Always test three cases: the normal case, the limit and the failure. Whoever tests only the normal case tests what works anyway.
Diagram
Exercise
Task
A pipe analyzer “Tank” measures the tank pressure, the volume pump “Fuellpumpe” fills it.
- pump on below 1500 kPa, off from 2000 kPa, keep the state in between
- the LED display “Starts” counts how often the pump has started
- if the analyzer fails: pump off
Try your solution in the IC10 coder first with a coupling Pump.On → Tank.Pressure (factor 50) and Δ/tick −10 on the pressure.
Hints
Hint 1
The hysteresis is the and/or pattern from week 7.
Hint 2
You count starts with an edge on pumping, not on the pressure.
Hint 3
In the simulator the trend shows whether the pump swings cleanly.
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