How can I request a Slave device to send me data, using Modbus communication blocks for Arduino in Simulink?
Mostra commenti meno recenti
I am using an Arduino Mega to communicate with a Thermostat device. The communication protocol is Modbus via RS485. I use my Arduino as Master and the ThermoStat as a Slave device. I know that I need to request the data first from my slave, using the master. I know the Slave address (254), Baud Rate (9,600), and that the information I need to read is a 16-bit integer at register adress 130 of the slave (which is a temperature). Does anybody have experience with the Arduino Modbus blocks to help me establish communication?
Risposte (1)
Raj
il 17 Apr 2024
0 voti
As per your query, I am able to understand that you want to communicate between an Arduino as Master and ThermoStat as a Slave device using Modbus via RS485 as the communication protocol. MODBUS RTU RS485 serial communication protocol follows the client/server architecture. This is unlike the popular I2C serial communication protocol which follows master/slave architecture.
MATLAB provides various function blocks suck as Client Read, Client Write, Server Read, Server Write for Modbus protocol. For better understanding on how to configure your network and establish communication between Arduino and thermostat, you can refer to a similar example on MODBUS RS485 Communication Between Client and Server Using Arduino Board and adapt accordingly-
You can also refer to following documentation page on Modbus properties moving ahead with your peoject-
I hope this helps and you are able to proceed further!
2 Commenti
Christos Dimosthenous
il 17 Apr 2024
I've also observed that we're unable to input register values greater than 255. It might be beneficial to reach out to MathWorks technical support for better assistance and to explore any possible workarounds.
Categorie
Scopri di più su Modbus Communication in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!