> 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/simplewritearrayofword.md).

# SimpleWriteArrayOfWord

## `SimpleWriteArrayOfWord` (FB)

`FUNCTION_BLOCK` SimpleWriteArrayOfWord

### Darstellung

<figure><img src="/files/cvstEnY5phk57hCNZ170" alt=""><figcaption></figcaption></figure>

### **Auslösung der Übertragung von Modbus-Daten**

Die Datenübertragung wird ausgelöst, falls mindestens eine der nachfolgend beschriebenen Bedingungen erfüllt ist:

Voraussetzung: Es ist ein geeignetes Array am Eingang `arwInputArray` angeschlossen. Dies wird durch den Ausgang `xInputArrayValid` (= TRUE) signalisiert.

1. nach einem Flankenwechsel am Eingang `xUpdateSetp` (FALSE >> TRUE) (einmalig)
2. nach Ablauf der Zeitdauer `tTimeUpdateSetp` (`tTimeUpdateSetp` > 0) (zyklisch)
3. nach einer Änderung des Arrays am Eingang `arwInputArray` (Datentyp, Grösse, Inhalte) (einmalig)
4. nach einer Änderung wesentlicher Parameter (`byUnitId`, `wRegisterAddr`) (einmalig)
5. nach einem Flankenwechsel am Eingang `xEn` (FALSE >> TRUE) (einmalig)
6. nach jedem Kaltstart (einmalig)

Hinweis: Der Datentyp des Arrays am Eingang `arwInputArray` kann Stand 07.07.2023 nicht erkannt und ausgewertet werden (CDS-43675 Compiler, AnyType: Extension for Arrays needed) In der ToolTipp-Hilfe zum Eingang `arwInputArray` werden die möglichen Array-Datentypen in Abhängigkeit vom gewählten Function-Code angezeigt.

InOut:

| Scope       | Name               | Type                                        | Initial                                               | Comment                                                                                                                                                             |
| ----------- | ------------------ | ------------------------------------------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | `xEn`              | `BOOL`                                      | TRUE                                                  | Freigabe / Sperrung der Kommunikation (TRUE = Freigabe)                                                                                                             |
| Input       | `byUnitId`         | `BYTE`                                      | 0                                                     | Modbus-Adresse des Geräts                                                                                                                                           |
| Input       | `arwInputArray`    | `__SYSTEM.AnyType`                          |                                                       | <p>Eingang für das Array der zu schreibenden Daten (FC16,<br><code>ARRAY OF WORD</code>, <code>ARRAY OF UINT</code> (16 Bit je Element))</p>                        |
| 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      | `wRegisterAddrFb`  | `WORD`                                      | 0                                                     | <p>Rückmeldung - Startadresse des Registers für das Modbus-<br>Telegramm</p>                                                                                        |
| Output      | `diInputArrayNumb` | `DINT`                                      | 0                                                     | Anzahl der Arrayelemente am Eingang `arwInputArray`                                                                                                                 |
| Output      | `xInputArrayValid` | `BOOL`                                      | FALSE                                                 | <p>Gültigkeit des Arrays am Eingang <code>arwInputArray</code> (Datentyp,<br>Grösse) (FALSE = nicht gültig, TRUE = gültig)</p>                                      |
| Output      | `xAlarm`           | `BOOL`                                      | FALSE                                                 | Sammelstörung (TRUE = Störung)                                                                                                                                      |
| Output      | `xAlarmCom`        | `BOOL`                                      | FALSE                                                 | Sammelstörung - Kommunikation (TRUE = Störung)                                                                                                                      |
| Output      | `eErrorCodeCom`    | ModbusErrorCode                             | ModbusErrorCode.NO\_ERROR                             | Fehlercode - Kommunikation (0 = kein Fehler)                                                                                                                        |
| Output      | `eErrorCodeDev`    | SIMPLE\_WRITE\_ARRAY\_OF\_WORD\_ERROR\_CODE | SIMPLE\_WRITE\_ARRAY\_OF\_WORD\_ERROR\_CODE.NO\_ERROR | Fehlercode - Gerät (0 = kein Fehler)                                                                                                                                |
| Output      | `xBusy`            | `BOOL`                                      | FALSE                                                 | Kommunikationsanzeige (TRUE = Kommunikation)                                                                                                                        |
| Input Const | `wRegisterAddr`    | `WORD`                                      |                                                       | Startadresse des Registers 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/simplewritearrayofword.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.
