What you learn today
- ImportCount and ExportCount
- Measure throughput
- Reset counters
How much does the smelter manage per minute? Is one arc furnace enough, or does it need a second? Those are questions about throughput – and the machines already count along for that.
ImportCount and ExportCount
Almost every machine with a chute connection keeps two counters:
| LogicType | counts |
|---|---|
ImportCount | how many items it has taken in |
ExportCount | how many items it has output |
That holds for furnaces, arc furnace, fabricators, recycler, centrifuge, sorter, stacker, deep miner, vending machine and also for chute inlet and outlet. Items are counted, i.e. stacks – a stack of 50 ore is one.
Measuring throughput
A counter alone says little, it keeps growing. What is interesting is how fast it grows. Once a minute the chip takes the difference to the last value:
sub rate now old
move old now
max rate rate 0
The chip reads the first old value before the start label, so the first minute does not show the whole previous count as throughput.
Resetting counters
ClearMemory 1 sets the device's ImportCount and ExportCount to 0. After that old has to go to 0 as well, otherwise the next minute would give a huge negative difference:
sbn ARC HASH("Lichtbogen") ClearMemory 1
move old 0
If somebody else resets the counter, max rate rate 0 catches the one negative value, and from the minute after that it is right again.
Compare ImportCount and ExportCount of the same machine over a longer time. If much more comes in than goes out, something is backing up inside – or the machine combines many items into one, like a furnace that turns ore into ingot stacks.
Exercise
Task
The arc furnace is named “Lichtbogen”. “Ausgaben” shows ExportCount, “Eingaenge” ImportCount (−1 each without furnace). Once a minute (120 ticks) “ProMinute” shows the growth of ExportCount since the last minute, never negative, −1 without furnace. A press on “Reset” writes ClearMemory 1 and sets the remembered value to 0.
Hints
Hint 1
Reset: check the button with sgtz, otherwise jump to show.
Hint 2
Totals every tick, with snanz and select … -1.
Hint 3
Minute part behind blt tick TICKS start: sub, move old now, max … 0.
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