> 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-2-the-architecture-of-the-selmo-system/2.2-the-switching-mechanism-the-sequence-engine.md).

# 2.2 The switching mechanism – the sequence engine

#### Task and significance

The sequence logic – in Selmo **Sequence Engine** called – is the central control logic.\
It is a **deterministic automaton**, which always knows exactly\
which state the machine is in and when it may continue operating.

You can imagine the sequence logic as a functional block\
that has three inputs and one output:

* **Inputs:**
  * *AR (Auto Release)* – indicates whether the automation is enabled.
  * *¬I (No Interlock)* – shows that no safety fault is active.
  * *ΣS (Sum of Sequence Checks)* – is 0 when all active actions have provided their feedback.
* **Output:**
  * *State\_ID* – the current switch position, i.e. the active state.

As long as any of these conditions is not met, the sequence logic remains stopped.\
When all are met, it switches to the next state.

#### The rule of the sequence logic

Its mode of operation can be reduced to a single formula:

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

This rule is universal.\
It replaces complex program logic with a formal condition\
that applies equally to every machine.

> **Suggested representation:**\
> An IEC box with labeling:\
> *SEL\_SEQ\_ENGINE*\
> On the left three inputs (AR, ¬I, ΣS), on the right one output (State\_ID).\
> Below it the phrase: *"Only one active state – deterministic cycle"*.

<figure><img src="/files/52c0e82d0212cbace1670f3f23f5a3e43f28e99f" alt=""><figcaption></figcaption></figure>

#### Structure in the Logic Layer

In the Logic Layer the states are modeled graphically.\
Each state is a block in the flow diagram, connected by arrows\
that represent the transition to the next state.

A sequence logic can contain the following logical elements:

1. **State** – a normal process state with defined actions.
2. **Decision** – a branch, e.g. "If part present → Path A, otherwise Path B."
3. **Timer-State** – a state that proceeds automatically after a time.
4. **Repeater** – repeats one or more states.
5. **Jump** – jumps deliberately to another state, absolute or conditional.

These elements are sufficient to fully map any machine process.\
They are chosen so they remain interpretable in any control system.


---

# 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-2-the-architecture-of-the-selmo-system/2.2-the-switching-mechanism-the-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.
