Modbus/TCP
Modbus/TCP
This topic describes the RMC support of the Modbus/TCP Ethernet protocol. Whether you are using it to communicate with the RMC from a PLC or from a custom application, this information may be useful.
The Modicon Modbus/TCP protocol is one of the simplest protocols and has an open standard. This means the protocol specification is publicly available. See the Modicon Modbus/TCP web site at http://www.modbus.org for complete details on the protocol.
Supported Modbus function codes:
-
Read Multiple Registers (FC 3)
-
Read Input Registers (FC 4)
-
Write Single Register (FC 6)
-
Get Diagnostics (FC 8)
-
Write Multiple Registers (FC 16)
-
Read/Write Registers (FC 23)
Addressing and Data Format
See the Modbus Addressing topic.
Implementation Notes
While the Modicon Modbus/TCP web site has documentation and sample code for its Modbus/TCP protocol, it is worth pointing out a few specifics on communicating with the RMC over Modbus/TCP. This section neither replaces nor modifies the Modbus/TCP specification, but clarifies key points and defines the RMC's function support.
-
To create a connection with the RMC over Modbus/TCP, open a client socket with the RMC on TCP port 502. The RMC will only respond to Modbus/TCP requests on this port. Other ports are reserved or used by other protocols.
-
The Unit Identifier (Slave Address) field in the Modbus/TCP is only used by routing devices. Since the Slave Address is not used by the RMC, it should be set to zero (0) in requests to the RMC.
-
Typically, only functions 3 and 16 are used. Function 23 can be used to improve performance by doing a read and write in a single function. FC 4 and 8 were included for compatibility with existing Modbus/TCP masters, but otherwise add no value to the RMC.
-
The RMC handles incoming packets on a first-in first-out (FIFO) basis, making it possible to send multiple requests and then wait for the replies.
-
The RMC can handle up to 64 open TCP/IP connections at once. Typically each device uses one connection at a time, allowing the RMC to be connected to up to 64 devices at once.
-
Multiple-register reads and writes are limited to 100 16-bit words for writes and 125 16-bit words for reads—per the Modbus/TCP specification—even though the length field in the Modbus/TCP header makes it look like larger packets would be supported.
-
Floating point numbers are 32-bit values and use two (2) holding registers each. The least significant 16 bits comes first.
See Also
RMC Ethernet Protocols | Ethernet Overview
Copyright (c) 2005-2012 by Delta Computer Systems, Inc.
