How can I request a Slave device to send me data, using Modbus communication blocks for Arduino in Simulink?
4 views (last 30 days)
Show older comments
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?
0 Comments
Answers (1)
Raj
on 17 Apr 2024
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!
See Also
Categories
Find more on Modeling in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!