ljean / modbus-tk

Create Modbus app easily with Python
Other
557 stars 211 forks source link

Added functionality for FC7, FC23 and FC43 #160

Closed enev13 closed 2 years ago

enev13 commented 2 years ago

Hello, Long time ago I've added master support for FC23. Now, for the needs of our work I also implemented slave support for FC7 and FC23 and master support for FC43 and I decided to contribute back to the project.

Please note: Regarding FC43, since the code is already defined as "DEVICE_INFO", I decided to hardcode the MEI Type as 0x0E, which corresponds to "Read Device Identification" according to Modbus specification. I mention this, because it could also have value of 0x0D but this brings entirely different functionality for this function code - "CANopen General Reference Request and Response PDU" (for reference see Modbus Application Protocol V1.1b, pages 42-47)

Although the new functionality was tested with our own tests and hardware and seems to be working fine, I suggest implementing and adding your own unit tests to verify it.

Best Regards, Petar Enev