> 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-5-anwendung-im-selmo-studio/5.2-arbeiten-im-logic-layer.md).

# 5.2 Arbeiten im Logic Layer

Der Logic Layer zeigt das **Schaltwerk** als grafisches Ablaufdiagramm.\
Man legt hier die Zustände (States) an und verbindet sie mit Pfeilen (Transitions).\
Jeder Zustand ist eine logische Schaltstellung der Maschine.

#### **Schritt 1 – Neue SEQ anlegen**

Im Projektbaum wählt man *Add Sequence* und vergibt einen Namen, etwa `SEQ_MainProcess`.\
Damit ist das Grundgerüst geschaffen.

#### **Schritt 2 – Zustände hinzufügen**

Über *Add State* werden Zustände angelegt, z. B.:

1. Home – Wait for Start
2. Cylinder 1 Extend
3. Calculation Start
4. Cylinder 2 Extend
5. Wait for Start (Return)
6. Calculation Reset
7. Cylinder 1 Retract
8. Cylinder 2 Retract → Back to Home

Jeder Zustand bekommt einen sprechenden Namen und optional einen kurzen Text für das HMI.

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

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

#### **Schritt 3 – Übergänge definieren**

Die Zustände werden mit Pfeilen verbunden.\
Ein Pfeil beschreibt, wann und wohin das Schaltwerk wechselt.\
Der Wechsel erfolgt automatisch, wenn die Standardregel erfüllt ist:

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

Damit entfällt jede manuelle Bedingungsformulierung – die Engine weiß selbst, wann sie weiter darf.

#### **Schritt 4 – Besondere Elemente**

Zusätzlich zu normalen Zuständen können eingefügt werden:

* **Decision:** logische Verzweigungen (z. B. Teil ok/nicht ok).
* **Timer-State:** automatisch nach Zeitwechsel (nicht sicherheitsrelevant).
* **Repeater:** Schleifen oder Prüfzyklen.
* **Jump:** definierte Sprünge (Service, Fehler, Notlauf).

Diese Elemente erweitern den Ablauf, ohne das Grundprinzip zu verändern.


---

# 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-5-anwendung-im-selmo-studio/5.2-arbeiten-im-logic-layer.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.
