You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I would like to report that I have found an use case where the library does not conform to modbus protocol.
Trying to reach invalid addresses should return an exception code 0x02 as per the protocol. The pymodbus library conveniently has a way to label some addresses as invalid in the setup.json file, but this functionality has been a bit broken since the change from 3.9.0.
The setup.json in this file has only 4 memory locations where addresses 0 and 1 are invalid and addresses higher than 3 do not exist. Observe that with version 3.8.6, accessing address 0 makes the server print the correct function code (131) with the correct exception code (2), because 0 is marked as invalid in setup.json. Still, accessing address 4 should have made the server print the same values as the case with address 0 since it is invalid because its out of range. Instead, the server builds a 0x00 exception response with SLAVE_FAILURE exception code. which the client understands as IO failiure instead of a normal exception. Now, with version 3.9.0, the case with address 0 returns no issue, and the problem with address 4 still exists.
I would really appreciate if you would let me know if I did anything wrong in my setup to cause these issues.
The text was updated successfully, but these errors were encountered:
First of all, pymodbus library is adhering to the modbus standard, you talk about the server with the simulator datastore and I do not think you have done anything wrong....except maybe not having tried with address 5, since 4 is borderline.
Returning SLAVE_FAILURE is a general failure and not against the modbus standard, actually a lot of "simpler" devices only return this code, however it is correct that the simulator used to return ILLEGAL_ADDRESS.
What the server print is not really not a concern, but what it returns to the client is a concern.
With v3.9.0 some validation was dropped, but it seems that the datastore simulator was cut a bit too deep. Internally we no longer work on that simulator datastore, but with a new simulator (not yet publicly available) which will be part of v4.x.
We will look into making ILLEGAL_ADDRESS appear again, however I am not sure if an out of bound address should be ILLEGAL _ADDRESS, I have 2 devices on my desk which both report SLAVE_FAILURE in that case.
Hi. I would like to report that I have found an use case where the library does not conform to modbus protocol.
Trying to reach invalid addresses should return an exception code 0x02 as per the protocol. The pymodbus library conveniently has a way to label some addresses as invalid in the setup.json file, but this functionality has been a bit broken since the change from 3.9.0.
Steps to reproduce:
python simulator.py
python client.py 0
python client.py 4
The
setup.json
in this file has only 4 memory locations where addresses 0 and 1 are invalid and addresses higher than 3 do not exist. Observe that with version 3.8.6, accessing address 0 makes the server print the correct function code (131) with the correct exception code (2), because 0 is marked asinvalid
insetup.json
. Still, accessing address 4 should have made the server print the same values as the case with address 0 since it is invalid because its out of range. Instead, the server builds a 0x00 exception response with SLAVE_FAILURE exception code. which the client understands as IO failiure instead of a normal exception. Now, with version 3.9.0, the case with address 0 returns no issue, and the problem with address 4 still exists.I would really appreciate if you would let me know if I did anything wrong in my setup to cause these issues.
The text was updated successfully, but these errors were encountered: