Main Content

Modbus Communication

Communicate with Modbus® servers to access controllers, probes, and other instruments

Industrial Communication Toolbox™ supports the Modbus interface over TCP/IP or Serial RTU. You can use it to communicate with Modbus servers, 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.

Create the interface object using the modbus function, and use the read, write, writeRead, and maskWrite functions for communication.

For an example that shows the entire workflow of reading a register from a PLC, see Read Temperature from a Remote Temperature Sensor.

You can also read and write to coils and registers using the Modbus Explorer, which offers a graphical user interface to easily set up reads and writes, and a live plot to see the values. For information, see Use the Modbus Explorer App. For an example that shows the entire workflow of reading and writing to a PLC using the app, see Control a PLC Using the Modbus Explorer.

Functions

modbusCreate Modbus object
readRead data from Modbus server
writePerform a write operation to the connected Modbus server
writeReadPerform write and read operation on groups of holding registers in single Modbus transaction
maskWritePerform mask write operation on a holding register

Apps

Modbus ExplorerRead and write to Modbus coils and registers (Since R2019a)

Topics

Modbus Communication Using Programmatic Workflow

Modbus Communication Using the Modbus Explorer

Troubleshooting

Troubleshooting the Modbus Interface

Try these tips if you have problems using the toolbox Modbus interface. See information about Modbus supported platforms, configuration and connection, and other interface-specific tips.