# SimpleWriteArrayOfInt

## `SimpleWriteArrayOfInt` (FB)

`FUNCTION_BLOCK` SimpleWriteArrayOfInt

### Representation

<figure><img src="/files/53f47a1d1d32b0457ef3afa4610f934a482f9f5e" alt=""><figcaption></figcaption></figure>

### **Triggering the transmission of Modbus data**

The data transmission is triggered if at least one of the following conditions described below is met:

Requirement: A suitable array is connected at the input `ariInputArray` connected. This is indicated by the output `xInputArrayValid` (= TRUE).

1. after an edge change at the input `xUpdateSetp` (FALSE >> TRUE) (once)
2. after the elapsed time `tTimeUpdateSetp` (`tTimeUpdateSetp` > 0) (cyclic)
3. after a change in the array at the input `ariInputArray` (data type, size, contents) (once)
4. after a change of essential parameters (`byUnitId`, `wRegisterAddr`) (once)
5. after an edge change at the input `xEn` (FALSE >> TRUE) (once)
6. after each cold start (once)

Note: The data type of the array at the input `ariInputArray` cannot be detected and evaluated as of 07/07/2023 (CDS-43675 Compiler, AnyType: Extension for Arrays needed) In the tool tip help for the input `ariInputArray` the possible array data types are displayed depending on the selected function code.

InOut:

| Scope       | Name               | Type                                       | Initial                                              | Comment                                                                                                                                              |
| ----------- | ------------------ | ------------------------------------------ | ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | `xEn`              | `BOOL`                                     | TRUE                                                 | Enable / disable communication (TRUE = enable)                                                                                                       |
| Input       | `byUnitId`         | `BYTE`                                     | 0                                                    | Modbus address of the device                                                                                                                         |
| Input       | `ariInputArray`    | `__SYSTEM.AnyType`                         |                                                      | <p>Input for the array of data to be written (FC16,<br><code>ARRAY OF INT</code> (16 bits per element))</p>                                          |
| Input       | `xUpdateSetp`      | `BOOL`                                     | FALSE                                                | Update of setpoints (on every rising edge)                                                                                                           |
| Input       | `xResError`        | `BOOL`                                     | FALSE                                                | <p>Reinitialization of the outputs <code>eErrorCodeCom</code> or<br><code>eErrorCodeDev</code> to the error-free state (on every<br>rising edge)</p> |
| Inout       | `ModbusClient`     | `ModbusClientBase`                         |                                                      | Client of the device                                                                                                                                 |
| Output      | `wRegisterAddrFb`  | `WORD`                                     | 0                                                    | <p>Feedback - start address of the register for the Modbus<br>telegram</p>                                                                           |
| Output      | `diInputArrayNumb` | `DINT`                                     | 0                                                    | Number of array elements at the input `ariInputArray`                                                                                                |
| Output      | `xInputArrayValid` | `BOOL`                                     | FALSE                                                | <p>Validity of the array at the input <code>ariInputArray</code> (data type,<br>size) (FALSE = not valid, TRUE = valid)</p>                          |
| Output      | `xAlarm`           | `BOOL`                                     | FALSE                                                | Collective fault (TRUE = fault)                                                                                                                      |
| Output      | `xAlarmCom`        | `BOOL`                                     | FALSE                                                | Collective fault - communication (TRUE = fault)                                                                                                      |
| Output      | `eErrorCodeCom`    | ModbusErrorCode                            | ModbusErrorCode.NO\_ERROR                            | Error code - communication (0 = no error)                                                                                                            |
| Output      | `eErrorCodeDev`    | SIMPLE\_WRITE\_ARRAY\_OF\_INT\_ERROR\_CODE | SIMPLE\_WRITE\_ARRAY\_OF\_INT\_ERROR\_CODE.NO\_ERROR | Error code - device (0 = no error)                                                                                                                   |
| Output      | `xBusy`            | `BOOL`                                     | FALSE                                                | Communication display (TRUE = communication)                                                                                                         |
| Input Const | `wRegisterAddr`    | `WORD`                                     |                                                      | Start address of the register for the Modbus telegram                                                                                                |
| Input Const | `tTimeUpdateSetp`  | `TIME`                                     | TIME#0ms                                             | <p>Update interval for the processes influenced by the input<br><code>xUpdateSetp</code> influenced</p>                                              |


---

# Agent Instructions: 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:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-modbus-library/functionblocks/generic/simplewritearrayofint.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
