REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Solved Modbus TCP getting Error -309

    Modbus TCP
    2
    8
    790
    Loading More Posts
    • 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.
    • cechuratC
      cechurat
      last edited by cechurat

      Split topic from https://forum.rexygen.com/topic/203/modbus-rtu-multiple-read/3

      1 Reply Last reply Reply Quote 0
      • A
        Apollo @cechurat
        last edited by

        @cechurat The hardware is installed and now I'm trying to get the Modbus TCP communication up and running.

        Data is coming in but I get these error messages regularly (I'm using the 'passive' feature) :

        2964a3eb-a329-49b1-a772-3bf5027cd8d1-image.png

        A 1 Reply Last reply Reply Quote 0
        • A
          Apollo @Apollo
          last edited by Apollo

          This is the data which we want to read out :

          f0b26cfe-a3cb-41ce-9055-21d73cb20fd4-image.png

          If period is not set to 1sec then there is no data at all, only error messages.
          Data from registers configured at line 17 to 21 in the above list are also not showing.

          If only the first chunk of 56 registers is configured everything is working more or less fine (with socket errors from time to time)

          Is there anything I can do to improve this?

          In the future, we need to read the same data not from one but from four devices. Would it make sense to sort the registers in this file in such a way that there is never a consecutively reading from the same device? Or doesn't it matter what the sequence is in this list?

          cechuratC 1 Reply Last reply Reply Quote 0
          • cechuratC
            cechurat @Apollo
            last edited by

            @apollo Hi Kris,

            I have few questions:

            1. What is timing of your project? (tasks and MbDrv)

            2. Can you record and share a log with settings from the following post?
              https://forum.rexygen.com/post/790
              (from the log you will also get an idea how the MbDrv sequencing works which might help you to improve the settings)

            Let me answer your question about registers order: Yes, it would make sense to mix the slaves. The order matter with respect to the same "Period" settings. (MbDrv works as a priority queue)

            Thanks for cooperation.

            Cheers,
            Tomas

            A 1 Reply Last reply Reply Quote 0
            • A
              Apollo @cechurat
              last edited by

              @cechurat
              In the meanwhile, I succeeded to get the communication up & running by reducing the Maxrequest value from 15 to 1.
              But still with some error messages from time to time.

              I do also have some Modbus clients which are already configured but not online yet. could it be that they cause some issues?

              exportModbusRex_20210303.csv

              modbus_cfg.rio

              apollo_exec.mdl

              cechuratC 1 Reply Last reply Reply Quote 0
              • cechuratC
                cechurat @Apollo
                last edited by

                @apollo Hi Kris,

                thanks for sharing additional information. Max. requests option is maximum number of Modbus telegrams in the queue. Especially the embedded devices with limited memory usually have a small TCP/IP stack buffer.

                The errors you get are probably referring to the offline clients:

                2021-03-03;18:04:37.690;Error;MBDRV: Socket receive error (idx=2, code=113);
                2021-03-03;18:04:37.690;Info;MBDRV: Client 2 disconnected;
                2021-03-03;18:04:37.690;Error;MBDRV:  Error while receiving data(ignore, code=-309);
                

                According to the log see which Clients are online/offline. Is that right?
                ee25850e-a8dc-4091-a1c5-bff094c6ab07-image.png

                Cheers,
                Tomas

                A 1 Reply Last reply Reply Quote 0
                • A
                  Apollo @cechurat
                  last edited by

                  @cechurat
                  Thank you for taking a look at it.

                  That's correct, these clients are still to be installed.

                  The idx parameter in the error message does this one refer to the clients in the config file, starting from idx=0 for the first entry?

                  cechuratC 1 Reply Last reply Reply Quote 0
                  • cechuratC
                    cechurat @Apollo
                    last edited by

                    @apollo Yes, you are right about the indexing. Starting with upcoming REXYGEN release the error message will contain Slave Name and its IP address for better understanding.

                    Cheers,
                    Tomas

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post

                    This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

                    There is also an outdated REXYGEN community forum.

                    Powered by NodeBB.