# Client\_TCP\_StateCode

## `Client_TCP_StateCode` (`ENUM`)

`TYPE` Client\_TCP\_StateCode: IDLE

Attributes: `qualified_only`

InOut:

| Name              | Initial | Comment                                                                                   |
| ----------------- | ------- | ----------------------------------------------------------------------------------------- |
| IDLE              | 0       | <p>Idle, initialize outputs (directly after startup /<br>after the Error state)</p>       |
| READY             | 10      | Ready for transmission of Modbus telegrams                                                |
| CHECK\_INPUT      | 20      | Checking the inputs for changes                                                           |
| RESOLVE           | 21      | Conversion of `sHostAddress` into an IP address                                           |
| RESOLVED          | 22      | Successful completion of name resolution                                                  |
| SET\_PARAMETER    | 23      | Configuration of the socket with the TCP parameters                                       |
| PENDING           | 30      | <p>Configuration of the socket / configuration of the TCP keep-alive<br>function</p>      |
| PREPARING         | 31      | Determination of the IP address and port of the TCP server                                |
| CONNECT           | 40      | <p>Establishing the connection between the client and the<br>server</p>                   |
| CONNECTION\_CHECK | 41      | Checking the successfully established connection                                          |
| CONNECTED         | 50      | <p>Connection between the client and the server was<br>successfully established</p>       |
| SEND              | 60      | Sending the Modbus request telegram (Request)                                             |
| CHECK\_SEND       | 61      | <p>Checking whether sending the Modbus request telegram (<br>Request) is possible</p>     |
| RECEIVE           | 70      | Receiving the Modbus response telegram (Response)                                         |
| CHECK\_RECEIVE    | 71      | <p>Checking whether receiving the Modbus response telegram (<br>Response) is possible</p> |
| ERROR             | 99      | Error state / teardown of the connection                                                  |
