Skip to content

Conversation

@chintal
Copy link
Contributor

@chintal chintal commented Apr 25, 2018

_rtu_byte_count_pos for GetCommEventLogResponse is incorrect. This causes incorrect parsing of such responses from RTU slaves / servers.

For reference, a valid RTU response to this command, generated from hardware but using firmware I've written, looks like :
0x5 0xc 0x9 0x0 0x0 0x0 0x0 0x0 0x3 0x80 0x42 0x80 0xb7 0xdd
(With a slave address of 0x5)

As an aside, though this PR does not address the problem, the exception produced is greatly misleading due to the 'Process incoming packets irrespective error condition' approach, which results in the ModbusClient attempting to parse the response using the slave address (unit) as the function code. This can be avoided by atleast stripping the prefix characters from the command (self._hsize) in the event of an error.

@dhoomakethu dhoomakethu merged commit 180060a into pymodbus-dev:dev Apr 25, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants