ljean / modbus-tk

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

Is there a function that flags when the TCPServer receives a packet? #170

Closed meetAndEgg closed 1 year ago

meetAndEgg commented 1 year ago

I am using the modbus-tk to build a modbustcp server. The data needed to be sent is larger than the limit of modbus, so i need to split it up and send it several times. And i want to write a loop at the master to ask the server several times to get complete data. Here is the problem. When the server in modbus_tk receive the message form master, it will send the data to master directly, but I dont know when it happens. Is there a function that flags when the TCPServer receives a message or sends a part of the data? So i can use the flag to update the data to which needed to be sent every times after server sent data.

meetAndEgg commented 1 year ago

@ljean

meetAndEgg commented 1 year ago

Actually, I have solved this problem. I found the developer had set up some hooks for users, which can easily implement the functions I mentioned above.