Main Content

Troubleshooting the Modbus Interface

Industrial Communication Toolbox™ supports the Modbus® interface over TCP/IP or serial RTU protocols. Use the interface to communicate with Modbus servers, for tasks such as controlling a PLC, communicating with a temperature controller, controlling a stepper motor, sending data to a DSP, reading bulk memory from a PAC controller, or monitoring temperature and humidity on a Modbus probe.

Using the Modbus interface, you can:

  • Read coils, inputs, input registers, and holding registers.

  • Write to coils and holding registers.

  • Perform a combination of one write operation and one read operation on groups of holding registers in a single Modbus transaction.

  • Modify the contents of a holding register using a mask write operation.

Supported Platforms

Industrial Communication Toolbox supports the Modbus interface on these platforms.

  • Linux® 64-bit

  • macOS 64-bit

  • Microsoft® Windows® 64-bit

Configuration and Connection

  1. If you are connecting to a local or remote device over Modbus, make sure that the device is powered on and available.

  2. Industrial Communication Toolbox can communicate over Modbus using TCP/IP or serial RTU protocols. If you are connecting via TCP/IP protocol, you need to know the IP address or host name of the Modbus server. If you are connecting via serial RTU protocol, you need to specify the serial port the Modbus server is connected to.

  3. Use the modbus object to connect to your server or device. You do not need a separate connection function to create a connection. For more information on the arguments that you must specify to create the modbus object and for examples of syntaxes, see Create a Modbus Connection.

  4. Once you have created the Modbus connection, you can communicate with your device. See Read Temperature from a Remote Temperature Sensor for an example of communicating with a device. See Other Troubleshooting Tips for Modbus for tips about communication issues after initial connection.

Other Troubleshooting Tips for Modbus

Consider the following tips when using the Modbus interface.

Address Range

When specifying read and write addresses, the addresses must be in the range 0–65535.

Byte Order

When configuring a Modbus client you must match the byte order and word order with that of the Modbus server. Refer to the vendor documentation to know these details about the Modbus server.

Modbus Addresses

When communicating with a device, use the correct Modbus address for a register. For example, refer to the device vendor documentation to map a PLC register to the correct Modbus address for the register.

Some vendors include an extra digit in addresses. Devices are usually represented by a four-digit address, and some vendors use a fifth digit to represent the type of target. The target can be coils, holding registers, or input registers. Each target is represented with a unique number. If your device vendor uses a five-digit representation, you may need to adjust the address accordingly.

The Modbus functions in Industrial Communication Toolbox use 1-based addressing whereas Modbus uses 0-based addressing. The toolbox subtracts 1 from any addresses that you pass in via the address parameters in the read and write functions.