Modbus RTU more than one response for multi reg reads.
-
Hello,
I'm using Qt 5.15.2 running on Ubuntu 20.02.2 with 57600,8,n,1, serial. No retries and 2sec response timeout. For single modbus register reads my app console always shows one request and one response. During multi register reads, in this case 2 registers, I get a combination of one or two responses. It seems to me that the only difference is that a single response always has the complete CRC16 at the end ('bb' VS 'bbec'). An example:
In addition, on the physical wire there is always only one response, never two like the console suggests. This response always has the complete 2-byte CRC. Arrows show an example of one frames complete CRC. Top waveform is request frames and bottom is response frames.
The code is working, but I would like to understand the issue. I'd hate to be giving away some performance that I don't have to. Any thoughts are greatly appreciated,
Andrei -
Cheers!
What is the slave's state when you try to read registers? During intensive workload (e.g. Manchester encoding) some MCUs can behave kinda faulty, because they lack computing power to manage simultaneous tranfer and computation.
If that's not the case, try implementing pauses in read commands. Sometimes even the dumbest things can help to debug and run the code properly :)
Is that problem still urgent?
-
Sorry, sleeping on the job... It's working Beaver so it's not exactly urget, but I just wanted to understand. Again, on the wire everything is correct, one request one response. It's the console suggesting occasional two responses. Since then I have notices the more registers I request in a single read the more likely to have multiple responses.
Perhaps the console is showing a response buffer on a cyclical "tick" and that buffer continues to get displayed until the complete response is in the buffer. I don't know. Thanks for the response.