- ‘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 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Rijuta
le 13 Oct 2023
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 commentaires
Voir également
Catégories
En savoir plus sur Run on Target Hardware dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!