> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/codesys-hvac/hvac-modbus-library/functionblocks/generic/simplewritevaluecoil.md).

# SimpleWriteValueCoil

## `SimpleWriteValueCoil` (FB)

`FUNCTION_BLOCK` SimpleWriteValueCoil

### Darstellung

<figure><img src="/files/4UCqofd4r91egOOBIJti" alt=""><figcaption></figcaption></figure>

### Verwendung von Typkonvertierungsoperatoren (z.B. REAL\_TO\_WORD) direkt am Eingang `InputValue`

In dieser Konstellation werden Compiler-Fehlermeldungen vom Typ C0032 erzeugt, ein Download ist nicht möglich.

{% hint style="info" %}
Abhilfe:

Verwendung einer Zwischenvariablen vom expliziten Typ `WORD` direkt am Ausgang des Typkonvertierungsoperators. Anbindung der Zwischenvariablen am Eingang `InputValue`.
{% endhint %}

### Codesys

InOut:

| Scope       | Name              | Type                              | Initial                                      | Comment                                                                                                                                                             |
| ----------- | ----------------- | --------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | `xEn`             | `BOOL`                            | TRUE                                         | Freigabe / Sperrung der Kommunikation (TRUE = Freigabe)                                                                                                             |
| Input       | `byUnitId`        | `BYTE`                            | 0                                            | Adresse des Geräts                                                                                                                                                  |
| Input       | `InputValue`      | `__SYSTEM.AnyType`                |                                              | Eingangsvariable zur Bestimmung der Zustände der Coils (FC05, FC15) (`BYTE`, `WORD`, `DWORD`, `LWORD`)                                                              |
| Input       | `xUpdateSetp`     | `BOOL`                            | FALSE                                        | Aktualisierung der Sollwerte (bei jeder ansteigenden Flanke)                                                                                                        |
| Input       | `xResError`       | `BOOL`                            | FALSE                                        | <p>Reinitialisierung der Ausgänge <code>eErrorCodeCom</code> bzw.<br><code>eErrorCodeDev</code> auf den fehlerfreien Zustand (bei jeder<br>ansteigenden Flanke)</p> |
| Inout       | `ModbusClient`    | `ModbusClientBase`                |                                              | Client des Geräts                                                                                                                                                   |
| Output      | `eFunctionCodeFb` | WriteFunctionCodesCoil            |                                              | Rückmeldung - Modbus-Function-Code für das Modbus-Telegramm                                                                                                         |
| Output      | `wCoilAddrFb`     | `WORD`                            |                                              | <p>Rückmeldung - Startadresse des Coils für das Modbus-<br>Telegramm</p>                                                                                            |
| Output      | `xAlarm`          | `BOOL`                            |                                              | Sammelstörung (TRUE = Störung)                                                                                                                                      |
| Output      | `xAlarmCom`       | `BOOL`                            |                                              | Sammelstörung - Kommunikation (TRUE = Störung)                                                                                                                      |
| Output      | `eErrorCodeCom`   | ModbusErrorCode                   |                                              | Fehlercode - Kommunikation (0 = kein Fehler)                                                                                                                        |
| Output      | `eErrorCodeDev`   | SIMPLE\_WRITE\_VALUE\_ERROR\_CODE |                                              | Fehlercode - Gerät (0 = kein Fehler)                                                                                                                                |
| Output      | `xBusy`           | `BOOL`                            |                                              | Kommunikationsanzeige (TRUE = Kommunikation)                                                                                                                        |
| Input Const | `eFunctionCode`   | WriteFunctionCodesCoil            | WriteFunctionCodesCoil.FC05\_WriteSingleCoil | Modbus-Function-Code für das Modbus-Telegramm                                                                                                                       |
| Input Const | `wCoilAddr`       | `WORD`                            |                                              | Startadresse des Coils für das Modbus-Telegramm                                                                                                                     |
| Input Const | `tTimeUpdateSetp` | `TIME`                            | TIME#0ms                                     | <p>Updateintervall für die Vorgänge, die durch den Eingang<br><code>xUpdateSetp</code> beeinflusst werden</p>                                                       |


---

# 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://support.powerio.com/hub/codesys-hvac/hvac-modbus-library/functionblocks/generic/simplewritevaluecoil.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.
