> 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/en/hvac-knx-library/functionblocks/knx_write_dpt_2x.md).

# KNX\_Write\_DPT\_2x

## `KNX_Write_DPT_2x` (FB)

FUNCTION\_BLOCK KNX\_Write\_DPT\_2x EXTENDS SlaveBasicWr

#### Overview

Send function for DPT 2.x (2-bit value).

#### Inputs

| Inputs                    | Initial value | Description                     |
| ------------------------- | ------------- | ------------------------------- |
| `xUpdateSetp`             | *FALSE*       | Trigger for target value update |
| `xValue`                  | -             | Main value to send (BOOL)       |
| `xPrio`                   | -             | Priority value to send (BOOL)   |
| `xWriteVisu`              | -             | Trigger for one-time send       |
| `eDPT_Format`             | -             | DPT 2.x format selection        |
| `byAdrGroup`              | *0*           | Group address (0-255)           |
| `byAdrMiddleGroup`        | *0*           | Middle group address (0-7)      |
| `byAdrMainGroup`          | *0*           | Main group address (0-31)       |
| `tTimeUpdateSetp`         | *T#0S*        | Cyclic update interval          |
| `tPauseTimeUntilNextSend` | *T#3S*        | Send pause                      |

#### Outputs

* `tNextWrite` (TIME): Time until the next write operation
* `xLastBusValue` (BOOL): Last received main value
* `xControlBit` (BOOL): Last received control bit (priority)

#### Usage

1. Select the DPT 2.x format with `eDPT_Format`.
2. Set the main value to send in `xValue` and the priority value in `xPrio`.
3. Configure the sending options:
   * For cyclic sending: `tTimeUpdateSetp` > T#0S
   * For event-based sending: Use `xUpdateSetp` or `xWriteVisu`
4. Monitor `xLastBusValue` for the last received main value.
5. Note `xControlBit` for the last received priority value.

InOut:

| Scope       | Name                      | Type            | Initial    | Comment                                                                                                                          | Inherited from |
| ----------- | ------------------------- | --------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------- |
| Input       | `itfKnxConnector`         | `IKnxConnector` |            | <p>IMasterConnector interface input to register/unregister<br>the FB to the List on the Master</p>                               | SlaveBasicWr   |
| Input       | `xEnable`                 | `BOOL`          | TRUE       |                                                                                                                                  | SlaveBasicWr   |
| Output      | `sPhysicallAddressDevice` | `STRING(15)`    |            |                                                                                                                                  | SlaveBasicWr   |
| Output      | `sGroupAddress`           | `STRING(15)`    |            |                                                                                                                                  | SlaveBasicWr   |
| Input       | `xUpdateSetp`             | `BOOL`          | FALSE      | <p>Update of setpoints ( on each rising edge<br>)</p>                                                                            |                |
| Input       | `xValue`                  | `BOOL`          |            |                                                                                                                                  |                |
| Input       | `xPrio`                   | `BOOL`          |            |                                                                                                                                  |                |
| Input Const | `xWriteVisu`              | `BOOL`          |            | Read once                                                                                                                        |                |
| Input Const | `eDPT_Format`             | DPT\_2x         |            | Enum DPT\_2x                                                                                                                     |                |
| Input Const | `byAdrGroup`              | `BYTE`          | 0          | Groupaddress                                                                                                                     |                |
| Input Const | `byAdrMiddleGroup`        | `BYTE`          | 0          | Middle-Group-Address                                                                                                             |                |
| Input Const | `byAdrMainGroup`          | `BYTE`          | 0          | Main-Group-Adress                                                                                                                |                |
| Input Const | `tTimeUpdateSetp`         | `TIME`          | TIME#0ms   | <p>Update interval for the operations influenced by the input<br>‘xUpdateSetp’ 0 = no automatic<br>update, > 0 cyclic update</p> |                |
| Input Const | `tPauseTimeUntilNextSend` | `TIME`          | TIME#3s0ms | Pause after sending 0 = no pause                                                                                                 |                |
| Output      | `tNextWrite`              | `TIME`          |            |                                                                                                                                  |                |
| Output      | `xLastBusValue`           | `BOOL`          |            |                                                                                                                                  |                |
| Output      | `xControlBit`             | `BOOL`          |            |                                                                                                                                  |                |


---

# 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/en/hvac-knx-library/functionblocks/knx_write_dpt_2x.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.
