Use the Modbus Explorer App
You can read and write to coils and registers using the Modbus Explorer app. The app supports a subset of the MATLAB® Modbus® functionality. You can do the following in the Modbus Explorer:
The app does not support the functionality of the Modbus writeRead
function or the maskWrite
function.
The Modbus Explorer offers a graphical user interface to easily set up reads and writes, and a live plot to see the values. The read table allows you to easily organize and manage reads for multiple addresses, such as different sensors on a PLC.
To launch the Modbus Explorer, do one of these:
In the MATLAB Apps tab, under Test & Measurement, select Modbus Explorer.
At the MATLAB command line, type
modbusExplorer
.
To use the Modbus Explorer, you need to configure your device and connect over TCP/IP or Serial RTU. For information about how to configure and connect to your device, see Configure a Connection in the Modbus Explorer. Once a device is configured and recognized by MATLAB, it appears for selection on the Modbus Explorer startup screen.
After you have successfully configured your device in the Configure tab, click Confirm Parameters to open the read and write section of the Modbus Explorer. You can then perform reads and writes. For information about doing reads, see Read Coils, Inputs, and Registers in the Modbus Explorer. For information about doing writes, see Write to Coils and Holding Registers in the Modbus Explorer.