> 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-documentation/4-structure-of-the-machine-static/sequence.md).

# Sequence

**Goal:** Core logic\
**Content:**

* What is a sequence?
* State machine
* Area of responsibility
* Example sequence

### 1. Why are there sequences?

In classic PLC programs, sequences, safety logic, operation and diagnostics are often mixed together.\
Logic arises implicitly in the code – not as an explainable model.

This leads to typical problems:

* unclear responsibilities
* hard-to-follow sequences
* high dependence on the programmer
* lack of formal description of machine behavior

**The sequence exists to solve this problem.**

It separates **functional responsibility** clearly from:

* Operation
* Safety
* implementation

***

### 2. What is a sequence?

A **Sequence** is a **deterministic behavior model** for a clearly delimited functional task of a machine.

A sequence:

* describes **what** happens – not how it is programmed
* is a **State machine**
* has a clear start, run and end state
* is self-contained and unambiguously responsible

Examples of typical sequences:

* clamping a workpiece
* processing cycle
* positioning an axis
* inspection procedure
* releasing and freeing

> **One task – one sequence.**

***

### 3. Classification in the overall Selmo model

The sequence is part of a clear hierarchical structure:

* **Plant** – entire machine / plant
* **hardware zone** – operating and responsibility framework
* **Sequence** – functional sequence responsibility
* **Zone** – connection to the real technology

The sequence itself:

* decides **not**, whether it may start
* manages **no operating modes**
* knows **not UI logic**

It describes exclusively **functional behavior**.

***

### 4. Structure of a sequence

A sequence is only fully defined when all relevant layers are described:

* **Logic layer**\
  describes the logical flow via states and transitions
* **System layer (bit control)**\
  defines the expected behavior of the zones in each state
* **Parameter layer**\
  contains temporal, position-related or quantity-dependent values

> Only the interplay of these layers makes a sequence unambiguous, testable and deterministic.

***

### 5. Sequence and logic layer (overview)

The logic layer describes the flow of a sequence as a state model.

Essential principles:

* A state describes **a situation**, not an action
* transitions occur only when conditions are met
* The sequence is uniquely determinable at any time

Details on state types and logic elements are in the chapter **Logic layer** .

***

### 6. Sequence and system layer (bit control)

The sequence itself defines **states** –\
the **behavior of the real technology** is described via the system layer.

The following applies:

* Each zone is evaluated in every state
* The expected or allowed behavior is explicitly specified
* There are no implicit assumptions

The complete definition of the operands and their meaning is provided in the chapter **Bit-Control**.

***

### 7. Behavior of a sequence in operation

A sequence is at any time in **exactly one state**.

Regardless of the operating mode, the following applies:

* States remain valid
* Expectations remain active
* Monitoring remains active

In operation this means:

* States are met or not met
* Deviations are unambiguously localizable
* Reactions occur deterministically

A sequence knows **no special cases** for manual or automatic operation –\
it always works in the same state space.

***

### 8. Distinction from other elements

To clarify:

* A **Sequence** is **not a hardware zone**\
  → it does not control operation or start release
* A **Sequence** is **no zone**\
  → it does not represent concrete technology
* A **Sequence** is **not a safety function**\
  → safety arises through modeled monitoring, not through the sequence
* A **Sequence** is **not a code module**\
  → it is a formal behavior model

***

### 9. Typical modeling errors in sequences

Common mistakes are:

* sequences with too large functional responsibility
* technical states instead of logical states
* mixing sequence and safety logic
* operating mode logic inside the sequence
* implicit assumptions instead of explicit modeling

A good rule of thumb:

> **If a sequence cannot be explained in one sentence, it is too large.**

***

### 10. Summary

A sequence is:

* the central functional unit in Selmo
* a deterministic state model
* clearly delimited and responsible
* independent of operation, UI and implementation

It forms the basis for:

* clean sequences
* automatic diagnosis
* traceable documentation
* safe extensibility

> **Whoever understands the sequences, understands the machine.**


---

# 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-documentation/4-structure-of-the-machine-static/sequence.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.
