stationeers.de Mod workshop · Dominik1199
DE Sign in
  1. Home
  2. IC10 academy
  3. Day 228

Day 228 of 365 · Pro · Month 8: Production

Producing quantities

An order for a fixed quantity: reset the counter with ClearMemory, count via ExportCount, trigger every piece anew and stop at the target.

Lesson 20 min Week 33

What you learn today

  • Set a target quantity
  • Count and stop
  • Restart the order

Yesterday you saw how many frames there are. Today the chip makes sure exactly as many get made as were ordered – not one more, not one less.

One piece per Activate

An autolathe makes one piece with Activate 1 and then sets Activate back to 0 itself. For 20 pieces it therefore needs 20 triggers. The chip triggers every time the lathe is done and the order is still running:

beqz running start
lbn active LATHE HASH("Drehbank") Activate Average
bnez active start
sbn LATHE HASH("Drehbank") Activate 1

If a piece is running right now (active 1), the chip jumps back. So it never writes a 0 into Activate – that would cancel the running piece.

Counting and stopping

ExportCount counts how many items the lathe has output. So that an order starts at 0, ClearMemory 1 resets the counter – together with ImportCount:

sbn LATHE HASH("Drehbank") ClearMemory 1

The order runs as long as fewer have been made than ordered. That is a flag with and: once done, it stays off until a new order comes.

Restarting the order

A press on “Neu” takes the quantity from the dial, clears the counter and sets the flag. The dial may be turned afterwards without changing the running order – the chip has the target in a register.

Warning

ExportCount belongs to the lathe, not to the chip. If somebody else clears the counter, or a second chip interferes with ClearMemory, your order loses track. One chip that counts per fabricator, exactly.

If the lathe is missing, ExportCount is NaN. slt with NaN gives 0, the order ends, and nothing more gets triggered.

Exercise

Task

A press on the button “Neu” takes the quantity from the dial “Stueckzahl”, writes ClearMemory 1 to the lathe “Drehbank” and starts the order. While ExportCount is below the target, “Auftrag” is lit and the chip writes Activate 1 as soon as the lathe is not active. “Gefertigt” shows ExportCount.

Hints

Hint 1

New order: check the button with sgtz, otherwise jump to counting with beqz.

Hint 2

Flag: slt tmp done target, and running running tmp.

Hint 3

Trigger only when running is 1 and the lathe's Activate is 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

Esc
↑ ↓ selectEnter open/ opens search anywhere