What you learn today
- Setpoints via dial
- Operating mode via lever
- Pass values to other chips
The base is growing, and several chips control the pressure in different areas. Instead of setting each one individually, the base gets a central desk. It takes the players' input, checks it and passes it on. Everything from this week in one chip.
The setup
| Device | Prefab | Name |
|---|---|---|
| dial (upper limit 120) | StructureLogicDial | Druck |
| lever | StructureLogicSwitch | Betrieb |
| logic memory | StructureLogicMemory | Solldruck |
| logic memory | StructureLogicMemory | Betriebsart |
| LED display | StructureConsoleLED5 | Pult |
| wall light | StructureWallLight | Bereit |
The two logic memories are the interface. The desk writes into them, the area chips read from them. That way every value has exactly one writer.
Milestones
- Setpoint via dial: the dial position is the target pressure in kPa. It is limited to 50 to 110 kPa and ends up in “Solldruck”.
- Operating mode via lever: 0 = off, 1 = automatic. The value ends up in “Betriebsart”, the light “Bereit” shows it.
- Feedback: the display “Pult” shows the target pressure that is really passed on.
- Failure: if the dial is missing, the last valid setpoint stays. If the lever is missing, the operating mode is 0.
Keeping the last value
So far you took a fixed fallback value on a failure. Here it is better to keep the last good value: the pressure in the base should not jump just because someone rebuilds the desk.
lbn new DIAL HASH("Druck") Setting Average
snan missing new
select target missing target new # no dial: old value stays
For that to work, target needs a start value before the start label. In the game a register keeps its value after an upload, but on the very first build there is just something in it.
Limit the value after the fallback. Then even an old value can never run out of the allowed range.
Write the logic memories only from this one chip. If an area chip wants to report something back, it gets its own housing Setting or its own logic memory for that.
Diagram
Project task
Task
Build the central desk with the devices and names from the table. The milestones are listed above the editor.
Milestones
- Milestone 1: setpoint via dial
- Milestone 2: operating mode via lever
- Milestone 3: feedback
- Milestone 4: dial and lever fail
Hints
Hint 1
select target missing target new keeps the old value without a dial.
Hint 2
Then limit to PRESSMIN to PRESSMAX with max and min.
Hint 3
Two sbn into the logic memories, two for display and light.
Quiz
2 questions. You pass from 60 % – the server does the grading.
Complete the day
- Passed all milestones of the project
- 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