# ModbusClient\_TCP\_Fast

## `ModbusClient_TCP_Fast` (FB) <a href="#modbusclient_tcp_fast-fb" id="modbusclient_tcp_fast-fb"></a>

`FUNCTION_BLOCK` ModbusClient\_TCP\_Fast EXTENDS ModbusClientBase

### **Darstellung**

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

### Funktionsbeschreibung <a href="#funktionsbeschreibung" id="funktionsbeschreibung"></a>

Dieser Funktionsbaustein erfüllt die Client-Funktionalitäten in einer Modbus-TCP-Kommunikation Die Gegenstelle muss die Server-Funktionalitäten erfüllen. Die Einführung erfolgte, um die Kommunikationsgeschwindigkeit bei einer Vielzahl von Modbus-Telegrammen zu erhöhen. Im Idealfall (= Vollständiger Empfang des Modbus-Response-Telegramms innerhalb einer Task-Zykluszeitdauer) wird zyklisch nach T = 3 \* Task-Zykluszeitdauer (T = 30ms bei einer Task-Zykluszeitdauer von 10ms) eine neue Übertragung gestartet. Bei Modbus-Telegrammen mit vielen Daten und/oder geringen Übertragungsraten auf der seriellen Seite (`RS` 485) kann sich diese Zeitdauer entsprechend erhöhen.

InOut:

| Scope       | Name                    | Type                             | Initial                                    | Comment                                                                                                                                                      | Inherited from   |
| ----------- | ----------------------- | -------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------- |
| Output      | `xConnected`            | `BOOL`                           |                                            | TRUE if connection has been established                                                                                                                      | ModbusClientBase |
| Output      | `xLicenceValid`         | `BOOL`                           |                                            | TRUE if a valid licence was found                                                                                                                            | ModbusClientBase |
| Input       | `xEn`                   | `BOOL`                           | TRUE                                       | Input to enable / disable the function block                                                                                                                 |                  |
| Input       | `sHostAddress`          | `STRING`                         | ‘’                                         | <p>Hostname (FQDN, e.g. <code>[www.focus.de](http://www.focus.de)</code>) or IP address of the<br>Server (e.g. <code>192.168.178.210</code>)(Modbus-TCP)</p> |                  |
| Input       | `wPort`                 | `WORD`                           | 502                                        | <p>Port number of the Server (Modbus-TCP)(502 is the default<br>port)</p>                                                                                    |                  |
| Input       | `xResetLastErrors`      | `BOOL`                           | FALSE                                      | Input to reset the error outputs (rising edge)                                                                                                               |                  |
| Output      | `byLastRequestUnitID`   | `BYTE`                           | 0                                          | Last Request telegram: Unit ID (0 = No Unit)                                                                                                                 |                  |
| Output      | `eState`                | Client\_TCP\_StateCode           | Client\_TCP\_StateCode.IDLE                | Current state of the state machine as `ENUM`                                                                                                                 |                  |
| Output      | `eResponseState`        | Client\_TCP\_Response\_StateCode | Client\_TCP\_Response\_StateCode.NO\_ERROR | Last Response telegram: Description of the state as `ENUM`                                                                                                   |                  |
| Output      | `byLastErrorUnitID`     | `BYTE`                           | 0                                          | Last error: Unit ID (0 = No Unit)                                                                                                                            |                  |
| Output      | `xError`                | `BOOL`                           | FALSE                                      | Current Error State (FALSE = No Error, TRUE = Error)                                                                                                         |                  |
| Output      | `eLastErrorCode`        | Client\_TCP\_ErrorCode           | Client\_TCP\_ErrorCode.NO\_ERROR           | Last Error: Description of the communication error as `ENUM`                                                                                                 |                  |
| Output      | `xReady`                | `BOOL`                           | FALSE                                      | <p>Current Standby state (FALSE = Not ready, TRUE = Ready to<br>send / receive Modbus data)</p>                                                              |                  |
| Input Const | `tKeepAliveTimeout`     | `TIME`                           | TIME#1m20s0ms                              | Time between the last package sent and the first probe (Idle-Mode)                                                                                           |                  |
| Input Const | `tTimeoutDeviceReceive` | `TIME`                           | TIME#2s0ms                                 | Timeout for the Device communication (Read)                                                                                                                  |                  |
| Input Const | `tTimeoutDeviceSend`    | `TIME`                           | TIME#2s0ms                                 | Timeout for the Device communication (Send)                                                                                                                  |                  |
| Input Const | `tTimeoutConnect`       | `TIME`                           | TIME#3s0ms                                 | <p>Timeout for the Client-Server communication (Resolve = name<br>resolution & Connection time)</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/hvac-modbus-library/functionblocks/generic/modbusclient_tcp_fast.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.
