Function Block: ModbusServer
Library: ModbusTCP Server
The function block processes up to 16 parallel client connection requests by Modbus TCP. Modbus requests work within data ranges which map the input and holding registers.
The following Modbus function codes are supported:
0x01Read Coils0x02Read Discrete Inputs0x03Read Holding Registers0x04Read Input Registers0x05Write Single Coil0x06Write Single Register0x0FWrite Multiple Coils0x10Write Multiple Registers0x17Read/Write Multiple Registers
The ModbusServer function block uses the parameters which have been configured on the device editor tab of the Modbus TCP Server.
Name | Data Type | Initial Value | Description |
|---|---|---|---|
|
|
| Server port (TCP/IP protocol stack) 502 is Modbus default |
|
| Pointer to | |
|
|
| Length of the array of input data ( |
|
| Pointer to | |
|
| Length of the array of output data ( | |
|
| Timeout (ms). If it is not zero and no Modbus write error has occurred until the timeout, then the output data is set to zero. | |
|
|
| Flag for starting request processing |
|
|
| Restart of normal communication with the servers; reset of status words and error bits for a rising edge |
|
| Name of the Ethernet interface (optional). When specified, the Modbus Server binds to the IP address of this interface. |
Name | Data Type | Initial Value | Description |
|---|---|---|---|
|
|
|
|
|
|
| Information about errors found |
|
|
| Number of connections |
|
| The timeout has expired. Holding registers and coils are set to zero. |