What you learn today
- Mode with Vent.Inward and Vent.Outward
- PressureExternal as target
- Switch the vent off safely
After a leak the room has to get its pressure back. After a fire the smoke has to go. The same active vent (StructureActiveVent) can do both – depending on how you set it.
Two directions
| Mode | Name | what it does |
|---|---|---|
| 0 | Vent.Outward | blows gas from the pipe into the room until the room reaches the target pressure |
| 1 | Vent.Inward | sucks gas from the room into the pipe while the room is above the target pressure |
It manages at most 10 kPa per tick, so a large room takes its time. It draws 100 W and only works when On = 1.
The two pressures
| LogicType | means |
|---|---|
PressureExternal | target pressure in the room: Outward fills up to it, Inward sucks down to it |
PressureInternal | limit in the pipe: Outward does not drain the pipe below it, Inward does not fill it beyond |
sbn VENT HASH("Zuluft") Mode Vent.Outward # once, before the loop
start:
yield
sbn VENT HASH("Zuluft") PressureExternal 100 # room up to 100 kPa, every tick
The trap: Mode resets the pressures
Every time Mode is written, the vent sets both pressures to their defaults: for Outward 101.325 kPa external and 0 internal, for Inward 0 external and a good 50,000 kPa internal.
Write Mode only once before the main loop, the pressures inside the loop. According to the game code the game only carries out the Mode change after the chip's tick and resets the pressures while doing so – a PressureExternal in the same tick is gone again afterwards. And writing Mode every tick, even with the same value, makes the vent work with the defaults every tick. If the direction has to change, write Mode only when it changes.
Supply and exhaust
A pair has proven itself: one vent “Zuluft” set to Outward, one “Abluft” set to Inward. Both get the same target pressure. The chip only decides which one may run right now:
slt supply press TARGET # too little pressure: supply
add tmp TARGET BAND
sgt exhaust press tmp # clearly too much: exhaust
Switching off safely
- If the room sensor fails, both vents off. A vent blowing on blindly can push a room beyond what the walls can take.
- To shut a vent down safely, write
On0 and lock it against manual operation withLock1.
sb VENT … would hit every active vent on the network, the airlock's too. Always address vents by name.
Exercise
Task
Pressure holding with supply and exhaust. On the network: gas sensor “Raum”, active vents “Zuluft” and “Abluft”.
- Before the loop: Zuluft to
Vent.Outward, Abluft toVent.Inward. - Inside the loop: both
PressureExternal= 100 kPa. - Zuluft on below 100 kPa.
- Abluft on above 110 kPa (target + 10).
- Sensor gone: both off.
Hints
Hint 1
Before start: only the two sbn lines for Mode. Both PressureExternal go into the loop, after yield.
Hint 2
Supply: slt supply press TARGET. Exhaust: first add tmp TARGET BAND, then sgt.
Hint 3
With NaN both comparisons are false – so both vents are off.
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