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

Day 254 of 365 · Pro · Month 9: Logistics and greenhouse

Automated hydroponics

The Harvie plants and harvests on command: Plant and Harvest, the busy arm, seeds in the import slot and the trap of harvesting too early.

Lesson 18 min Week 37

What you learn today

  • Plant and Harvest
  • Resupply seeds
  • Harvest cycle

Reporting ripeness is nice, but you still have to harvest yourself. The Harvie does that for you: it hangs above a hydroponics tray, plants from its import slot and puts the harvest into its export slot. It gets its commands from the chip over the data network.

The Harvie

LogicTypeDirectionmeans
Plantwriteplants the next seed from the import slot
Harvestwriteharvests the plant below
Activateread0 = arm free, 1 = planting, 2 = harvesting
Modereadface: 0 no plant, 1 happy, 2 unhappy, 3 dead
Onread and writewithout power and On it does nothing

Slots: 0 is the import (seeds or plants), 1 the export (the harvest), 2 the hand of the arm.

Plant and Harvest are commands, not switches. In the game code any value above 0 triggers the action, a 0 is ignored. So you may write sbn HARVIE HASH("Ernter") Harvest ripe every tick: as long as ripe is 0, nothing happens.

Warning

Harvest on an unripe plant does not harvest, it pulls the plant out and destroys it. It is the same action as “Clear” on the Harvie's button. Only write Harvest when the tray reports Mature = 1.

The harvest cycle

The chip decides anew every tick what to do:

  1. Is the arm busy (Activate not 0)? Then do nothing.
  2. Is the plant ripe? Then Harvest.
  3. Is the tray empty and are there seeds in the import? Then Plant.
lbn free HARVIE HASH("Ernter") Activate Average
seqz free free                 # 1 = arm free
lbns ripe TRAY HASH("Beet") 0 Mature Average
seq ripe ripe 1
and ripe ripe free
sbn HARVIE HASH("Ernter") Harvest ripe

Why the check on the arm? Planting and harvesting are arm movements that take a while. A command during that time is usually discarded, but your chip should not have to rely on that.

Resupplying seeds

The Harvie only plants what lies in the import slot. Quantity in slot 0 tells you how much is left. If the slot is empty, the tray stays empty after the harvest – a light should report that. You can refill by hand or through a chute into the Harvie's import.

Tip

Perennial plants such as tomatoes or pumpkins keep growing after the harvest. The tray then stays occupied and the Harvie does not need to plant again. The cycle above copes with both kinds.

Diagram

A locker with numbered slots Locker (d0) Slot 0 Iron ore Occ 1 Qty 5 Slot 1 Copper ore Occ 1 Qty 12 Slot 2 empty Occ 0 Qty 0 Slot 3 empty Occ 0 Qty 0 ls r0 d0 0 Occupied r0 = 1 ls r1 d0 1 Quantity r1 = 12 Slots count from 0. Values in a slot are called LogicSlotTypes.
The Harvie has three slots: import for seeds, export for the harvest and the hand of its arm.

Exercise

Task

Build the harvest cycle for the Harvie “Ernter” above the hydroponics device “Beet”:

  • only give commands while the arm is free (Activate = 0)
  • Harvest when the plant is ripe (Mature = 1)
  • Plant when the tray is empty (Occupied = 0) and there are seeds in import slot 0
  • light “Saat” on when the import slot is empty or the Harvie is missing

Write the commands as 0 or 1 – the Harvie ignores a 0.

Hints

Hint 1

seqz free free turns Activate into a 1 for “arm free”. With NaN that gives 0.

Hint 2

Harvest: seq ripe ripe 1, then and ripe ripe free, then sbn … Harvest ripe.

Hint 3

Plant: combine seqz empty empty and sgtz seed seed with and, plus free.

Quiz

5 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