> 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-solution/selmo-solution-en/selmo-how-it-works/selmo-training/chapter-5-application-in-the-selmo-studio/5.2-working-in-the-logic-layer.md).

# 5.2 Working in the logic layer

The logic layer shows the **switching mechanism** as a graphical flow chart.\
Here you create the states and connect them with arrows (transitions).\
Each state is a logical switching position of the machine.

#### **Step 1 – Create new SEQ**

In the project tree select *Add Sequence* and give it a name, for example `SEQ_MainProcess`.\
This establishes the basic framework.

#### **Step 2 – Add states**

Via *Add State* states are created, e.g.:

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

Each state is given a descriptive name and optionally a short text for the HMI.

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

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

#### **Step 3 – Define transitions**

The states are connected with arrows.\
An arrow describes when and where the switching mechanism changes.\
The change occurs automatically when the default rule is met:

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

This eliminates any manual formulation of conditions – the engine itself knows when it may proceed.

#### **Step 4 – Special elements**

In addition to normal states, the following can be inserted:

* **Decision:** logical branches (e.g. part ok/not ok).
* **Timer state:** automatic change after time (not safety-relevant).
* **Repeater:** loops or inspection cycles.
* **Jump:** defined jumps (service, error, emergency mode).

These elements extend the sequence without changing the basic principle.


---

# 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-solution/selmo-solution-en/selmo-how-it-works/selmo-training/chapter-5-application-in-the-selmo-studio/5.2-working-in-the-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.
