Generic vs Modicon Modbus Addressing


Thread Starter


Is there a device that converts generic modbus addressing to modicon modbus 5-digit or 6-digit addressing? We are converting a serial to a TCP/IP and the master device only has drivers for 5-digit / 6-digit addressing. We've already tried a variety of offsets and it doesn't seem to work. The gateway is just a pass-thru device. The slave device is a Elektronikon Mark IV with Serial Modbus. Oh, and AB Ethernet/IP is not an option either.

There's actually no such thing as 5 or 6 digit addressing in Modbus. All Modbus protocol addresses are 16 bit binary numbers between 0 and 65535. The 5 or 6 digits are in the user interface of the software which runs on your PC. The same thing goes with whether numbering starts at 0 or 1. That's entirely a PC software user interface (or user manual) artifact. If there's a problem, it's somewhere else.

If you are using different software to configure addressing, keep in mind that some manufacturers write their documentation (or PC software) such that the first digit (or prefix) of the "address" is not actually part of the address. Instead, it's a type prefix. For example, holding register "0" might be written as "0", "1", "30000", "30001", "300000", or "300001". The "real" Modbus address is holding register 0, and 0 is what gets sent out on the wire as Modbus. The other "addresses" are just someone's idea of how to write shorthand in the manual. The "3" in this case serves the same purpose as an "I" or "M" prefix in an IEC style address.

The 5 or 6 digit nonsense came about because some manufacturers had different amounts of memory in their PLCs, and they were relating how the PLC data table mapped to Modbus addresses. When they came out with a new PLC model that had more RAM, they just added more digits to the "address". The actual Modbus protocol address didn't change however.

With serial gateways make sure you check the unit id. With some gateways you have to configure this differently. The unit id is typically what is used to specify either the serial address or the serial port (on multi-port modules). Modbus/TCP is a straightforward mapping of serial (Modbus/RTU) to Ethernet, and the serial address was kept for the benefit of gateways.

Other than that, check the serial cables, pin-outs, baud rate, parity, etc. Also, make sure you can actually "ping" the gateway from whatever you are connecting it to. If you are using a PC with MS Windows, sometimes the problem is just that an MS Windows firewall won't let anything through until you turn it off or change it.