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:
0x01 Read Coils
0x02 Read Discrete Inputs
0x03 Read Holding Registers
0x04 Read Input Registers
0x05 Write Single Coil
0x06 Write Single Register
0x0F Write Multiple Coils
0x10 Write Multiple Registers
0x17 Read/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 WORD; points to the map of the Modbus input register | |
|
|
| Length of the array of input data (WORDs per register); default: 1024 |
|
| Pointer to WORD; points to the map of the Modbus holding register | |
|
| Length of the array of output data (WORDs per register) | |
|
| 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. |