How do you detect an ILLEGAL DATA ADDRESS when doing a chunked read covering multiple registers? #2778
-
The specification for the device I am accessing says certain registers are available, but they always throw an However, if the register is in the middle of chunked read covering multiple registers, then it does not throw an error. Is there any way to determine these illegal addresses in a multi-register read? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
What is a "chunked read" pymodbus do not have such a request ? If your device "throw" an ILLEGAL ADDRESS it will be "catched" by the software in your device, and never go on to the network? Normally your device will send an exception response, which your client will handle. If your device accept a read with multiple registers then it is legal. |
Beta Was this translation helpful? Give feedback.
-
I am using pymodbus (3.11.2) as a client. To improve performance, I am trying to read larger chunks of registers and then my code will use offsets within the returned registers to extract the actual values. However, the server I am accessing (not a pymodbus server; an actual device over TCP) has some registers documented that do not actually appear to be implemented. As a simple example, I have 4 contiguous registers numbered 30620 to 30623. Each contains a discrete UINT16 value. 30622 and 30623 are defined in the specification for the device, but when read with (e.g.) So, I am making a single, chunked read rather than 4 reads, and then I call I was hoping that there might be some way to detect (in this example) that the last 2 values I extract from the registers are in fact invalid. I can't see that there is a way, but I thought I would ask people with more experience in pymodbus. |
Beta Was this translation helpful? Give feedback.
That really have nothing to do with pymodbus, if you read with count=x and your device do not respond with an exception response, then pr modbus standard the request was legal !
If you send a request with count=x that includes invalid registers your device should return an exception response according to the standard. Please have a chat with the device vendor.
There are NO way you can detect invalid addresses if the device do not return an ExceptionResponse.