> For the complete documentation index, see [llms.txt](https://infosys.selmotech.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://infosys.selmotech.com/selmo-how-it-works/selmo-training/kapitel-2-die-architektur-des-selmo-systems/2.2-das-schaltwerk-die-sequence-engine.md).

# 2.2 Das Schaltwerk – die Sequence Engine

#### Aufgabe und Bedeutung

Das Schaltwerk – in Selmo **Sequence Engine** genannt – ist die zentrale Steuerlogik.\
Es ist ein **deterministischer Automat**, der immer genau weiß,\
in welchem Zustand sich die Maschine befindet und wann sie weiterarbeiten darf.

Man kann sich das Schaltwerk als einen Funktionsbaustein vorstellen,\
der drei Eingänge und einen Ausgang besitzt:

* **Eingänge:**
  * *AR (Auto Release)* – gibt an, ob die Automatik freigegeben ist.
  * *¬I (No Interlock)* – zeigt, dass kein Sicherheitsfehler aktiv ist.
  * *ΣS (Sum of Sequence Checks)* – ist 0, wenn alle aktiven Aktionen ihr Feedback geliefert haben.
* **Ausgang:**
  * *State\_ID* – die aktuelle Schaltstellung, also der aktive Zustand.

Solange eine dieser Bedingungen nicht erfüllt ist, bleibt das Schaltwerk stehen.\
Wenn alle erfüllt sind, wechselt es in den nächsten Zustand.

#### Die Regel des Schaltwerks

Die Funktionsweise lässt sich auf eine einzige Formel reduzieren:

**IF (AR = 1 AND ¬I AND ΣS = 0) THEN Next State**

Diese Regel ist universell.\
Sie ersetzt komplexe Programmlogik durch eine formale Bedingung,\
die für jede Maschine gleich gilt.

> **Darstellungsvorschlag:**\
> Ein IEC-Kasten mit Beschriftung:\
> *SEL\_SEQ\_ENGINE*\
> Links drei Eingänge (AR, ¬I, ΣS), rechts ein Ausgang (State\_ID).\
> Darunter der Satz: *“Only one active state – deterministic cycle”*.

<figure><img src="/files/ReKkxtKpaKtxIIMoMedA" alt=""><figcaption></figcaption></figure>

#### Aufbau im Logic Layer

Im Logic Layer werden die Zustände grafisch modelliert.\
Jeder Zustand ist ein Block im Ablaufdiagramm, verbunden mit Pfeilen,\
die den Übergang zum nächsten Zustand darstellen.

Ein Schaltwerk kann folgende logische Elemente enthalten:

1. **State** – ein normaler Ablaufzustand mit definierten Aktionen.
2. **Decision** – eine Verzweigung, z. B. „Wenn Teil vorhanden → Pfad A, sonst Pfad B“.
3. **Timer-State** – ein Zustand, der nach einer Zeit automatisch weitergeht.
4. **Repeater** – wiederholt einen oder mehrere Zustände.
5. **Jump** – springt gezielt in einen anderen Zustand, absolut oder bedingt.

Diese Elemente genügen, um jeden Maschinenablauf vollständig abzubilden.\
Sie sind so gewählt, dass sie in jedem Steuerungssystem interpretierbar bleiben.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://infosys.selmotech.com/selmo-how-it-works/selmo-training/kapitel-2-die-architektur-des-selmo-systems/2.2-das-schaltwerk-die-sequence-engine.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
