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?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Modbus Communication finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!