What you learn today
- Read an APC
- Battery inside the APC
- Switch an area off
The workshop should get a fuse of its own: if the main grid fails briefly, the printers keep running, and when power gets scarce you can switch off the whole area with one instruction. That is exactly the area power control (StructureAreaPowerControl, APC for short).
What the APC does
The APC sits between two networks: input (power and data) and output (power only). Everything behind the output is “its” area. A battery in slot 0 buffers the area. It charges from the input with at most 1000 W and steps in when the input is not enough.
Reading the APC
| LogicType | Meaning |
|---|---|
Mode | PowerMode.: 0 Idle, 1 Discharged, 2 Discharging, 3 Charging, 4 Charged |
Ratio | charge of the inserted battery, 0 … 1 (0 without battery) |
Maximum | capacity of the battery |
Charge | what the APC can offer right now: input plus battery |
On | 1 = area supplied, 0 = area switched off |
You read the battery itself through the slot: ChargeRatio and Occupied in slot 0.
lbns buffer APC HASH("Werkstatt") 0 ChargeRatio Average
lbns inside APC HASH("Werkstatt") 0 Occupied Average
What Mode really reports
Every tick the APC compares the battery content with the previous one: if it rises, it reports Charging (3), if it falls, Discharging (2), if the battery is full, Charged (4). If it stays the same, it says Discharged (1) – so that does not mean “empty” but rather “resting”. Idle (0) comes without battery and without power.
Switching an area off
On 0 switches the output off, the area is then without power. That is the lever for load shedding: one instruction for all devices behind it.
A removed lever returns NaN. seqz on lever would turn that into 0 and switch the workshop off. In the example only a real 0 switches off: seqz tmp lever is 0 for NaN, seqz on tmp is then 1.
Discharging means: the APC is drawing on its own battery, the main grid is not enough right now. If that happens often, the area is too big for its feed – or the main grid too weak.
Exercise
Task
The APC “Werkstatt” supplies the workshop, the lever “Werkstatt” switches the area (lever already done).
- Display “APC”: the APC's
Mode, display “Puffer”: battery in slot 0 in percent, −1 without battery - Flashing light “Puffer” on when the APC reports
PowerMode.Dischargingand its battery is below 25 % - APC gone: light on, both displays −1
Hints
Hint 1
Read Mode with lbn, slot 0 with lbns: ChargeRatio and Occupied.
Hint 2
Warning: seq warn mode DISCHARGING and “and” it with slt tmp buffer LOW, “or” in the missing APC.
Hint 3
Without a battery inside is 0 → select buffer inside buffer -1.
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