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 https://www.modbus.org for complete details on the protocol.

Supported Modbus function codes:

The following function codes are supported. Function codes 3 and 16 are the most common.

Addressing and Data Format

See the Modbus Addressing topic.

Implementation Notes

Word Order

RMC registers are Big-Endian 32-bit words and use two (2) holding registers each. In 32-bit words, the RMC expects that the least significant 16 bits comes first. Most Modbus masters have a setting for selecting this, since the Modbus protocol never specified this.

Zero-Based vs. One-Based

Modbus addresses that the user sees are 1-based. Since all RMC registers are 32-bit and use two Modbus registers, all RMC register addresses are therefore odd, for example 404097. However, internally to the protocol, the addresses are one-based. Some device manufacturers have confused this and mistakenly made their protocol zero-based for the user. In such cases, you will need to enter your addresses in the external device as zero-based. For example, the RMC address 408001 would be entered 408000.

Common Function Codes

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.

Unit Identifier (Slave Address)

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.

Advanced

Troubleshooting

If the data that is being read from or written to the RMC is appearing, but not correctly, the problem is likely one or more of the following:

 

Tip: To help determine word order or zero-based errors, set an RMC variable (not the first variable, or some problem may not show up easily) to a DWORD type, then in the external device, write a hexadecimal value, such as 16#11223344 to the RMC. You will quickly see in the RMC what the problem is.

 

 

See Also

RMC Ethernet Protocols | Ethernet Overview | Modbus Addressing


Send comments on this topic.

Copyright © 2024 Delta Computer Systems, Inc. dba Delta Motion