How can I request a Slave device to send me data, using Modbus communication blocks for Arduino in Simulink?
조회 수: 5 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Raj
2024년 4월 17일
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!
참고 항목
카테고리
Help Center 및 File Exchange에서 Modeling에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!