Closed Blacklagoon21 closed 5 years ago
According to the modbus specification, the function code should never be larger than 16. How do you propose we fix this? Maybe we should just validate whether the function code is in the list of modbus defined function codes and raise an exception when it's not?
I tried to make same situation for the error. and I realize that choose wrong modbus mode (it was RTU over TCP/IP). and it works on modbus TCP/IP and without any error.
In function pack_exception_pdu, when function_code is bigger then 16, struct.pack will error return.