Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Modbus RTU more than one response for multi reg reads.

Modbus RTU more than one response for multi reg reads.

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 517 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AndreiS
    wrote on last edited by
    #1

    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:
    Modbus_2responce.png
    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.
    Modbus_2responceLogicAnalyzer.png

    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

    J.HilkJ 1 Reply Last reply
    0
    • BeaverShallBurnB Offline
      BeaverShallBurnB Offline
      BeaverShallBurn
      wrote on last edited by
      #2

      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?

      -Knock knock
      -Who's there?
      -Compi
      -Compi who?
      -Compilation error

      1 Reply Last reply
      0
      • A AndreiS

        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:
        Modbus_2responce.png
        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.
        Modbus_2responceLogicAnalyzer.png

        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

        J.HilkJ Online
        J.HilkJ Online
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @AndreiS up the retry count, I remember there being very strange behaviours when setting it so 0 or 1.


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        A 1 Reply Last reply
        0
        • A Offline
          A Offline
          AndreiS
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @AndreiS up the retry count, I remember there being very strange behaviours when setting it so 0 or 1.

            A Offline
            A Offline
            AndreiS
            wrote on last edited by
            #5

            @J-Hilk Ok, that's concerning. I'll try it and report. Thanks for the feedback.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved