> 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/8-diagnosis-hmi-and-documentation/automatic-diagnosis.md).

# Automatic diagnosis

### Transparency through the model

This chapter describes, **how diagnosis arises in Selmo**\
and why it **does not require additional programming** is required.

Diagnosis in Selmo is:

* not an afterthought feature
* not a collection of error messages
* not UI logic

But:

> **The visible deviation between modeled target behavior**\
> **and the real actual state.**

***

### Where messages originate

Diagnosis arises **exclusively in the model**.

Specifically at the point where:

* a **state** is active
* a **zone** in this state has a meaning
* a **expectation or condition** is violated

Typical sources of diagnosis are:

* `S`-zones whose expected behavior is not met
* `i`-zones whose condition is violated
* CMZ whose permanent condition is not met
* plausibility checks (e.g. pair check)

> **Every diagnosis has a clear model origin.**

There are no messages:

* without zone
* without state
* without a defined expectation

***

### Why no extra programming is necessary

In classic systems, diagnosis is often:

* programmed manually
* duplicated in many places
* separated from the actual process

In Selmo this is not necessary because:

* behavior is modeled explicitly
* expectations are described unambiguously
* monitoring is an integral part of the model

The model already contains:

* what is expected
* when it is expected
* how to react in case of deviation

> **When the behavior is described,**\
> **the diagnosis follows inevitably.**

There are therefore:

* no additional error queries
* no "if error then message" logic
* no manually maintained message texts

***

### Relationship zone ↔ message

The **zone** is the smallest diagnosable unit in Selmo.

Each zone has:

* a unique meaning
* a clear context (sequence & state)
* a defined HMI text

When a deviation occurs:

* this exact zone is identified
* this exact context is displayed
* this exact expectation is named

The message thus answers:

* **Which zone** is affected?
* **In which state**?
* **Which condition** is violated?

> **The diagnosis not only explains&#x20;*****that*****&#x20;something is wrong,**\
> **but&#x20;*****why*****&#x20;the process cannot continue.**

***

### Determinism of the diagnosis

Since diagnosis arises from the model, it is:

* deterministic
* reproducible
* not interpretation-dependent

Same situation means:

* same message
* same cause
* same reaction

This applies:

* in automatic operation
* in manual operation
* during commissioning
* on restart

***

### Distinction from classic error messages

For clarification:

* Diagnosis ≠ PLC error bit
* Diagnosis ≠ collective fault
* Diagnosis ≠ UI text
* Diagnosis ≠ operator interpretation

Diagnosis is:

> **Model-based transparency about deviations.**

***

### Benefits of automatic diagnosis

Through automatic diagnosis, the following is achieved:

* troubleshooting becomes faster
* commissioning becomes safer
* operation becomes more comprehensible
* documentation consistent
* responsibility justifiable

> **Transparency does not arise from more messages,**\
> **but from the right messages.**

***

### Summary

Automatic diagnosis in Selmo:

* arises directly from the model
* does not require additional programming
* is clearly assigned to zone and state
* remains the same in all modes of operation

> **If the model is correct,**\
> **the diagnosis is also correct.**


---

# 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/8-diagnosis-hmi-and-documentation/automatic-diagnosis.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.
