How to read and write data to a Modbus server with different data formatting (different Byte Order and Word Order)
I am using the Industrial Communication Toolbox in MATLAB R2024b and I have been trying to read and write functions over TCP/IP using Modbus, however, I operate a server configured with a big-endian byte order and word order, and need to read and write data in a format where the word order is big-endian but the byte order is little-endian.
When I tried setting the MATLAB Modbus client to little-endian byte order it resulted in the following error when using the Modbus Explorer app:
Failure reading from Modbus device. Verify that the register properties and the Modbus connection parameters are accurate.
Whereas when trying this using the MATLAB Command Window with APIs I get the following error when performing "read" or "write":
A communication error occurred while reading from the Modbus server: Timeout occurred waiting for a response.
However, when setting the byte order to big-endian then I receive incorrect values and no error.
When using Modbus Poll it gives the correct result without error.
Why is this error occurring?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Modbus Communication에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!