Unlike Modbus serial link, Modbus TCP is not based on a hierarchical structure, but on a client/server model.
The Modicon M251 Logic Controller implements both client and server services so that it can initiate communications to other controllers and I/O devices, and to respond to requests from other controllers, SCADA, HMIs, and other devices. By default, Modbus Server functionality is not active.
Without any configuration, the embedded Ethernet port of the controller supports Modbus server.
The Modbus client/server is included in the firmware and does not require any programming action from the user. Due to this feature, it is accessible in RUNNING, STOPPED and EMPTY states.
The Modbus TCP client supports the following function blocks from the PLCCommunication library without any configuration:
ADDM
READ_VAR
SEND_RECV_MSG
SINGLE_WRITE
WRITE_READ_VAR
WRITE_VAR
For further information, refer to the Function Block Descriptions.
The Modbus server supports the Modbus requests:
Function Code Dec (Hex) |
Subfunction Dec (Hex) |
Function |
---|---|---|
1 (1) |
– |
Read digital outputs (%Q) |
2 (2) |
– |
Read digital inputs (%I) |
3 (3) |
– |
Read holding register (%MW) |
6 (6) |
– |
Write single register (%MW) |
8 (8) |
– |
Diagnostic |
15 (F) |
– |
Write multiple digital outputs (%Q) |
16 (10) |
– |
Write multiple registers (%MW) |
23 (17) |
– |
Read/write multiple registers (%MW) |
43 (2B) |
14 (E) |
Read device identification |