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 Modbus
writeRead
function or the maskWrite
function.
The Modbus Explorer offers a user interface to easily set up the read and write operations, and a live plot to see the values. The read table allows you to easily organize and manage reading from multiple addresses, such as different sensors on a PLC.
To launch the Modbus Explorer app:
In the MATLAB Apps tab, under Test & Measurement, select Modbus Explorer.
At the MATLAB command line, type
modbusExplorer
.
To use the Modbus Explorer, you must 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 you configure a device and it is recognized by MATLAB, you can select it in the Modbus Explorer app's startup page.
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 app. You can then perform read and write operations. For information on the read operation, see Read Coils, Inputs, and Registers in Modbus Explorer. For information on the write operation, see Write to Coils and Holding Registers in Modbus Explorer.
The app supports importing register information as a MAT file. You can import MAT files previously exported from the app. You can also import MAT files exported from the Modbus Client Read and Modbus Client Write Simulink® blocks.