> 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-1-the-theoretical-background/1.1-from-flow-code-to-machine-behavior.md).

# 1.1 From flow code to machine behavior

In classical PLC programming you think in **commands**:\
If a signal is present, a line of code is executed; if a condition is true, an output is set.\
This approach worked for decades, but it has two central weaknesses:

1. **The behavior of the machine** is only indirectly recognizable.\
   The program code describes, *what* is switched, but not, *why*.\
   Even experts often need hours or days to reconstruct from thousands of lines of code how a machine actually operates.
2. **The sequence is not formally described.**\
   A classical PLC can execute many branches, subprograms and side conditions simultaneously.\
   This leads to unpredictable states, race conditions and hard-to-reproduce errors.

Selmo takes a different approach:\
Instead of executing commands, it describes **behavior**.\
No longer “if input X, then output Y”, but “the machine is in state Z, and in this state the following rules apply.”

This changes the direction of thinking:\
From *programming* (writing instructions) to *modeling* (describing behavior).


---

# 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-1-the-theoretical-background/1.1-from-flow-code-to-machine-behavior.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.
