- ‘Modbus TCP/IP Client Read’: https://www.mathworks.com/help/supportpkg/raspberrypi/ref/modbustcpipclientread.html?s_tid=doc_ta
- ‘Modbus TCP/IP Client Write’: https://www.mathworks.com/help/supportpkg/raspberrypi/ref/modbustcpipclientwrite.html?s_tid=doc_ta#mw_47bfb4d1-3a0d-4ba3-9d91-4437214e44c7
How to specify serverID when using modbus for Raspberry Pi?
2 ビュー (過去 30 日間)
古いコメントを表示
Hi!
I have a Raspberry Pi that is running a modbus server. In Matlab I can easily communicating with the server by using the Industrial Communication Toolbox:
m = modbus('tcpip', '192.168.XX.XX', 502)
read(m,'holdingregs',49+1,7, 1)
Where the last input to the read function is the serverID.
My problem is that when I try to do the same thing using the modbus blocks in ther Raspberry Pi support package for Simulink there is no obvious way for how I can specify the serverID. Does anyone know how I can specify the serverID when using the modbus communication block in Simulink for Raspberry Pi?
Thanks!
0 件のコメント
回答 (1 件)
Rijuta
2023 年 10 月 13 日
Hi Kristian,
I understand that you want to specify the server ID of a Modbus communication block in Simulink for Raspberry Pi.
In Modbus communication, the server ID is essentially the address of the server to send the read command to. Simulink Support Package for Raspberry Pi Hardware supports the Modbus communication protocol over the TCP/IP network with the following blocks:
Both these blocks provide ‘Server address’ as a parameter which allows you to enter the IP address of the server device to identify the server from which the client reads the data or to which the client writes the data. The default value of the Server address is 127. You can double click on the block to modify this value.
I hope this solves your query.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Run on Target Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!