I noticed a problem when polling multiple (<20) singlecoils at rates of about 1 second: the transactionid of the modbus queries always stays the same. This is a big problem because responses for query X are more or less randomly taken as response for query Y. In other words: when you query a value, you do not neccessarily get the value from the address you want, instead the next response that arrives will be taken as answer, even if it belongs to another (previous) query.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At the moment this is no problem, because I only use Syncronous transmission to communicate with the Server.
- Send Request to Server
- Wait for response
- Return Coils
As soon as I will use asyncronous transmission(I will use it in the future), you are absolutely right, I will use the transaction ID to find the response for the appropriate request.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I noticed a problem when polling multiple (<20) singlecoils at rates of about 1 second: the transactionid of the modbus queries always stays the same. This is a big problem because responses for query X are more or less randomly taken as response for query Y. In other words: when you query a value, you do not neccessarily get the value from the address you want, instead the next response that arrives will be taken as answer, even if it belongs to another (previous) query.
At the moment this is no problem, because I only use Syncronous transmission to communicate with the Server.
- Send Request to Server
- Wait for response
- Return Coils
As soon as I will use asyncronous transmission(I will use it in the future), you are absolutely right, I will use the transaction ID to find the response for the appropriate request.