How to read and write some registers of a client machine over ModBus TCP/IP on Simulink.

2 views (last 30 days)
Daniel del Rivero Peña
Daniel del Rivero Peña on 3 May 2021
Hi, my name is Daniel, and I’m trying to read and write some vales from some MODBUS TCP registers from a converter with simulink blocks.
I have achieved it using Matlab functions and with the "Interpreted Matlab function" block, through the write and read functions. But this works quite slow.
Is there a way where I can read and write to certain registers from simulink using MODBUS?
I have tried several Matlab blocks, but I am not able to read or write the desired registers (i.e. dir. 17000, 16856 ..)
Thank you very much in advance.
All the best.

Answers (1)

Shiva Kalyan Diwakaruni
Shiva Kalyan Diwakaruni on 6 May 2021
In the Modbus TCP/IP Slave Read block, the slave device reads data from its registers. notify the slave to read data from a specific discrete input register, specify the discrete input register address in this parameter. For example, for the slave to read data from the discrete input register with the address 80, enter 80.
To enable this parameter, set Function to Read Discrete Input.
Check the paramter section in below links to know more
Hope it helps.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by