> 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-modbus-library/functionblocks/abb/abb_b21_23_24.md).

# ABB\_B21\_23\_24

## `ABB_B21_23_24` (FB)

`FUNCTION_BLOCK` ABB\_B21\_23\_24

### **Representation**

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2F49Vxh2huEuOAY7FbZIlU%2FABB_B21_23_24.png?alt=media&amp;token=59c22edb-a9d8-4d30-80d0-f008a1d162dc" alt=""><figcaption></figcaption></figure>

InOut:

| Scope       | Name                 | Type               | Initial       | Comment                                                                                                                                                  |
| ----------- | -------------------- | ------------------ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | `xEn`                | `BOOL`             | TRUE          | Enable / disable communication (TRUE = enable)                                                                                                           |
| Input       | `byUnitId`           | `BYTE`             | 0             | Address of the device                                                                                                                                    |
| Input       | `xUpdateActual`      | `BOOL`             | FALSE         | <p>Update of actual values (on every rising edge<br>)</p>                                                                                                |
| Input       | `xUpdateCounter`     | `BOOL`             | FALSE         | <p>Update of the meter readings (on every rising<br>edge)</p>                                                                                            |
| Input       | `xUpdateInfo`        | `BOOL`             | FALSE         | <p>Update of the serial number / device type (on every<br>rising edge)</p>                                                                               |
| Input       | `xResError`          | `BOOL`             | FALSE         | <p>Reinitialization of the outputs <code>eErrorCodeCom</code> on the<br>error-free state (on each rising edge)</p>                                       |
| Input       | `xSendSysCommand`    | `BOOL`             | FALSE         | <p>Activation of the transmission of system commands (on every<br>rising edge) (Prerequisite: valid address and<br>valid value)</p>                      |
| Inout       | `ModbusClient`       | `ModbusClientBase` |               | Client of the device                                                                                                                                     |
| Output      | `rU1N`               | `REAL`             |               | Phase voltage L1 - N in V                                                                                                                                |
| Output      | `rU2N`               | `REAL`             |               | Phase voltage L2 - N in V                                                                                                                                |
| Output      | `rU3N`               | `REAL`             |               | Phase voltage L3 - N in V                                                                                                                                |
| Output      | `rU12`               | `REAL`             |               | Line voltage L1 - L2 in V                                                                                                                                |
| Output      | `rU23`               | `REAL`             |               | Line voltage L2 - L3 in V                                                                                                                                |
| Output      | `rU31`               | `REAL`             |               | Line voltage L3 - L1 in V                                                                                                                                |
| Output      | `rIL1`               | `REAL`             |               | Line current L1 in A                                                                                                                                     |
| Output      | `rIL2`               | `REAL`             |               | Line current L2 in A                                                                                                                                     |
| Output      | `rIL3`               | `REAL`             |               | Line current L3 in A                                                                                                                                     |
| Output      | `rILN`               | `REAL`             |               | Current in the neutral conductor in A                                                                                                                    |
| Output      | `rPhaseAnglePowTo`   | `REAL`             |               | Phase angle - power - total in degrees                                                                                                                   |
| Output      | `rPowerFactorTo`     | `REAL`             |               | Power factor - total                                                                                                                                     |
| Output      | `rPowerFactorL1`     | `REAL`             |               | Power factor L1                                                                                                                                          |
| Output      | `rPowerFactorL2`     | `REAL`             |               | Power factor L2                                                                                                                                          |
| Output      | `rPowerFactorL3`     | `REAL`             |               | Power factor L3                                                                                                                                          |
| Output      | `rActivePowerTo`     | `REAL`             |               | Active power - total in W                                                                                                                                |
| Output      | `rActivePowerL1`     | `REAL`             |               | Active power L1 in W                                                                                                                                     |
| Output      | `rActivePowerL2`     | `REAL`             |               | Active power L2 in W                                                                                                                                     |
| Output      | `rActivePowerL3`     | `REAL`             |               | Active power L3 in W                                                                                                                                     |
| Output      | `rApparentPowerTo`   | `REAL`             |               | Apparent power - total in VA                                                                                                                             |
| Output      | `rApparentPowerL1`   | `REAL`             |               | Apparent power L1 in VA                                                                                                                                  |
| Output      | `rApparentPowerL2`   | `REAL`             |               | Apparent power L2 in VA                                                                                                                                  |
| Output      | `rApparentPowerL3`   | `REAL`             |               | Apparent power L3 in VA                                                                                                                                  |
| Output      | `rReactivePowerTo`   | `REAL`             |               | Reactive power - total in var                                                                                                                            |
| Output      | `rReactivePowerL1`   | `REAL`             |               | Reactive power L1 in var                                                                                                                                 |
| Output      | `rReactivePowerL2`   | `REAL`             |               | Reactive power L2 in var                                                                                                                                 |
| Output      | `rReactivePowerL3`   | `REAL`             |               | Reactive power L3 in var                                                                                                                                 |
| Output      | `rFrequency`         | `REAL`             |               | Frequency in Hz                                                                                                                                          |
| Output      | `rActiveTariff`      | `REAL`             |               | Active tariff                                                                                                                                            |
| Output      | `uliActEneImp`       | `ULINT`            |               | Imported active energy - total in kWh                                                                                                                    |
| Output      | `uliActEneImpTotal1` | `ULINT`            |               | Consumed active energy - Total - Tariff 1 in kWh                                                                                                         |
| Output      | `uliActEneImpTotal2` | `ULINT`            |               | Consumed active energy - Total - Tariff 2 in kWh                                                                                                         |
| Output      | `uliActEneImpTotal3` | `ULINT`            |               | Imported active energy - total - tariff 3 in kWh                                                                                                         |
| Output      | `uliActEneImpTotal4` | `ULINT`            |               | Imported active energy - total - tariff 4 in kWh                                                                                                         |
| Output      | `uliActEneExp`       | `ULINT`            |               | Exported active energy - total in kWh                                                                                                                    |
| Output      | `uliActEneExpTotal1` | `ULINT`            |               | Delivered active energy - Total - Tariff 1 in kWh                                                                                                        |
| Output      | `uliActEneExpTotal2` | `ULINT`            |               | Delivered active energy - Total - Tariff 2 in kWh                                                                                                        |
| Output      | `uliActEneExpTotal3` | `ULINT`            |               | Exported active energy - total - tariff 3 in kWh                                                                                                         |
| Output      | `uliActEneExpTotal4` | `ULINT`            |               | Exported active energy - total - tariff 4 in kWh                                                                                                         |
| Output      | `uliReaEneImp`       | `ULINT`            |               | Imported reactive energy - total in kVarh                                                                                                                |
| Output      | `uliReaEneImpTotal1` | `ULINT`            |               | Consumed reactive energy - Total - Tariff 1 in kVarh                                                                                                     |
| Output      | `uliReaEneImpTotal2` | `ULINT`            |               | Consumed reactive energy - Total - Tariff 2 in kVarh                                                                                                     |
| Output      | `uliReaEneImpTotal3` | `ULINT`            |               | Imported reactive energy - total - tariff 3 in kVarh                                                                                                     |
| Output      | `uliReaEneImpTotal4` | `ULINT`            |               | Imported reactive energy - total - tariff 4 in kVarh                                                                                                     |
| Output      | `uliReaEneExp`       | `ULINT`            |               | Exported reactive energy - total in kVarh                                                                                                                |
| Output      | `uliReaEneExpTotal1` | `ULINT`            |               | Delivered reactive energy - Total - Tariff 1 in kVarh                                                                                                    |
| Output      | `uliReaEneExpTotal2` | `ULINT`            |               | Delivered reactive energy - Total - Tariff 2 in kVarh                                                                                                    |
| Output      | `uliReaEneExpTotal3` | `ULINT`            |               | Exported reactive energy - total - tariff 3 in kVarh                                                                                                     |
| Output      | `uliReaEneExpTotal4` | `ULINT`            |               | Exported reactive energy - total - tariff 4 in kVarh                                                                                                     |
| Output      | `uliAppEneImp`       | `ULINT`            |               | Imported apparent energy - total in kVAh                                                                                                                 |
| Output      | `uliAppEneExp`       | `ULINT`            |               | Exported apparent energy - total in kVAh                                                                                                                 |
| Output      | `sDeviceType`        | `STRING`           |               | Device type and functionality                                                                                                                            |
| Output      | `dwSerialNum`        | `DWORD`            |               | Meter serial number (32 bit)                                                                                                                             |
| Output      | `xAlarm`             | `BOOL`             | FALSE         | Collective fault (TRUE = fault)                                                                                                                          |
| Output      | `xAlarmCom`          | `BOOL`             | FALSE         | Collective fault - communication (TRUE = fault)                                                                                                          |
| Output      | `eErrorCodeCom`      | ModbusErrorCode    |               | Error code - communication (0 = no error)                                                                                                                |
| Output      | `sErrorCodeDev_1`    | `STRING`           |               | <p>String 1 with the numbers of active device errors (Register<br>16#8A13)</p>                                                                           |
| Output      | `sErrorCodeDev_2`    | `STRING`           |               | <p>String 2 with the numbers of active device errors (Register<br>16#8A14)</p>                                                                           |
| Output      | `sErrorCodeDev_3`    | `STRING`           |               | <p>String 3 with the numbers of active device errors (Register<br>16#8A15)</p>                                                                           |
| Output      | `sErrorCodeDev_4`    | `STRING`           |               | <p>String 4 with the numbers of active device errors (Register<br>16#8A16)</p>                                                                           |
| Output      | `xBusy`              | `BOOL`             |               | Communication indicator (TRUE = communication)                                                                                                           |
| Input Const | `wSysRegVal`         | `WORD`             | 0             | Value of the register for the system command                                                                                                             |
| Input Const | `wSysRegAdr`         | `WORD`             | 16#8F00       | Address of the register for the system command                                                                                                           |
| Input Const | `xEnAlarmDevice`     | `BOOL`             | FALSE         | <p>Enable / block outputs <code>xAlarmDevice</code> or<br><code>stErrorCodeDev\_X</code> (FALSE = blocking of the evaluation of the<br>alarm states)</p> |
| Input Const | `tTimeUpdateInfo`    | `TIME`             | TIME#60m0s0ms | <p>Update interval for the operations that are influenced by the input<br><code>xUpdateInfo</code> influenced</p>                                        |
| Input Const | `tTimeUpdateCounter` | `TIME`             | TIME#5m0s0ms  | <p>Update interval for the operations that are influenced by the input<br><code>xUpdateCounter</code> influenced</p>                                     |
| Input Const | `tTimeUpdateActual`  | `TIME`             | TIME#1m0s0ms  | <p>Update interval for the operations that are influenced by the input<br><code>xUpdateActual</code> influenced</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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://support.powerio.com/hub/codesys-hvac/en/hvac-modbus-library/functionblocks/abb/abb_b21_23_24.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
