Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Modbus TCP] _readMemory error! Error: Data length error, expected 9 got 6 #1148

Closed
Ralience123 opened this issue Apr 7, 2024 · 11 comments
Closed
Labels

Comments

@Ralience123
Copy link

Hi!
I found a following error when using modbus tcp. Before testing fuxa,We checked the data type,tcp address and the slave address.They are correct,then I use modbus poll to read, there is no problem.
image
But when I use fuxa to read, the following error occurs. I tried to set up polling 5 sec,but it didn‘t work.
image
Your support is appreciated.

@rvbatista
Copy link
Contributor

Do you know why Modbus pool is showing -- for two registers? Are you able to use Wireshark with both?

@Ralience123
Copy link
Author

Yes,I use Wireshark to check the message both of them,and it didn't show any alarms or errors.
image
image

Do you know why Modbus pool is showing -- for two registers? Are you able to use Wireshark with both?

@rvbatista
Copy link
Contributor

The device is answering with different lengths for the same request?
Could you also get the Wireshark requests for those answers?

@Ralience123
Copy link
Author

I found something new today:There are no details about ‘Register’ under ‘Modbus’. Normally it should show up,like pic 2. Perhaps these messages were not recognized?
pic 1
image

pic 2
image

The device is answering with different lengths for the same request? Could you also get the Wireshark requests for those answers?

@IonuDragomir1
Copy link

Hi,
I get the same error for Modbus RTU. Did you find any solution to this?
My error message: 2024-04-12T11:16:53.352Z [ERR] 'ModbusRTU' _readMemory error! Error: Data length error, expected 11 got 1
After restarting the server, I get the values, but beside the above error, I also get this error: 2024-04-12T11:19:09.757Z [ERR] 'ModbusRTU' _readMemory error! Error: CRC error

@Ralience123
Copy link
Author

Hi, I get the same error for Modbus RTU. Did you find any solution to this? My error message: 2024-04-12T11:16:53.352Z [ERR] 'ModbusRTU' _readMemory error! Error: Data length error, expected 11 got 1 After restarting the server, I get the values, but beside the above error, I also get this error: 2024-04-12T11:19:09.757Z [ERR] 'ModbusRTU' _readMemory error! Error: CRC error

Hi,
You can use some modbus software like Modbus Poll or QModMaster to check the message. I think maybe your device did not parsing the message correctly,you also can find the error code in the message.

@Github-User-002
Copy link

Github-User-002 commented Apr 19, 2024

Hi I get the same CRC error on my polling, it only happens on ID: 5, holding register 2024 and duplpicate id: 1, 2001 and id: 5, HR: 2001, but only ID: 5 is showing the _readmemory error

Those messages look fine on modbus poll and wireshark, so I can't think the slave is doing anything wrong, it must be a bug in the FUXA

EDIT: If I make another device in Fuxa, with the register alone in it, then it shows up without problem. But I cannot have 2 devices on the same serial so it does not work as a workaround....

@unocelli
Copy link
Member

Hi, have you try to update the modbus library to v8.0.16

@Ralience123
Copy link
Author

Hi, have you try to update the modbus library to v8.0.16

Hi, I haven't upgraded this library yet, but I will do it later :)

@Ralience123
Copy link
Author

Hi, have you try to update the modbus library to v8.0.16

Hi. after checking the tcp server, I found that there was a byte error in the reply message, which caused the number of bytes to be incorrect. Now I have updated the server version and the problem has been resolved, thanks for your help and you can close the issue :)

@unocelli unocelli added the solved label May 3, 2024
@maufc
Copy link

maufc commented May 3, 2024

Hi.
I have this problem using ModbusTCP and Telnet, as a way to use ModbusRTUoverTCP.
I am not completely sure if RTUoverTCP is supported or not.
I find that 'trick' here:
#780
Anyway, I am getting _readMemory errors
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants