• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    MODBUS RTU 1ms inter-byte delay ISSUE

    Modbus4J general discussion
    3
    7
    7.4k
    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.
    • xbastekX
      xbastek
      last edited by xbastek

      modbus ascii works just fine

      19200,8,N,1 - NORMAL
      19200,8,N,1 - MANGO

      115200,8,N,1 - NORMAL
      115200,8,N,1 - MANGO

      PrtSc

      How can I fix this?

      ????
      modbus4j/serial/rtu/RtuMaster.java

      1 Reply Last reply Reply Quote 0
      • hussamH
        hussam
        last edited by

        can you give more detail information?

        1 Reply Last reply Reply Quote 0
        • xbastekX
          xbastek
          last edited by xbastek

          @xbastek said:

          RtuMaster.jav

          my test setup:
          SERVER (debian+mango demo license) <-> (USB<->RS485) <-> PLC <-> (RS485<->USB) <-> PC (Docklight)

          Distributor ID: Debian
          Description: Debian GNU/Linux 7.8 (wheezy)
          Release: 7.8
          Codename: wheezy

          Package mango: 2.5.2.5

          core 2.5.2 build 6 - *** unlicensed ***
          modbus 1.5.4 - *** unlicensed ***
          ....

          i configured one data source "Modbus Serial" with one data point - just for test
          MODBUS RTU 19200,8,N,1
          ...and...
          ...PLC do not respond... but Docklight read correct frame modbus rtu frame
          i send the same frame from Docklight and plc respond correctly..
          so i Hook-up scope and identified the problem...
          delays between individual bytes in frame.
          in ASCII mod there is no delays between bytes, works just fine...
          but i need RTU mod..

          I particularly don't like modbus4j/serial/rtu/RtuMaster.java
          it seam to by something with
          Thread.sleep.........
          this.characterSpacing.........
          i have never heard about character spacing in modbus rtu before...????

          is mango useing this code?

          1 Reply Last reply Reply Quote 0
          • terrypackerT
            terrypacker
            last edited by

            xbastek,

            Thanks for the in-depth information.

            From the Modbus spec here: http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf

            On page 13 at the bottom there is a remark about RTU that states:
            For baud rates greater than 19200 Bps, fixed values for the 2 timers should be used: it is recommended to use a value of 750μs for the inter-character time-out (t1.5) and a value of 1.750ms for inter-frame delay (t3.5).

            In the past we have had some issues with timing on some systems so we added a larger inter-character space.

            However your scope is showing spacing greater than the 750μs maximum which is causing the problem.

            To answer your question:

            is mango useing this code?
            Yes that is the code we use.

            Proposed solution:

            1. Add an additional constructor to the Modbus4j library that allows passing in the spacing.

            2. Add an additional constructor to the Modbus4j library that allows choosing to use 0 spacing or let the library compute the spacing based on the serial settings.

            3. Keep the existing constructor that defaults to computing the spacing.

            4. Expose the option to set the spacing in the Mango Modbus Data Source module.

            xbastekX 2 Replies Last reply Reply Quote 0
            • xbastekX
              xbastek @terrypacker
              last edited by xbastek

              @terrypacker spec.png

              my english is poor, i may don't understand it well enough..

              loock at libmodbus libmodbus-3.1.2/src/modbus-rtu.c

              1 Reply Last reply Reply Quote 0
              • xbastekX
                xbastek @terrypacker
                last edited by

                @terrypacker said:

                xbastek,

                Thanks for the in-depth information.

                From the Modbus spec here: http://www.modbus.org/docs/Modbus_over_serial_line_V1_02.pdf

                On page 13 at the bottom there is a remark about RTU that states:
                For baud rates greater than 19200 Bps, fixed values for the 2 timers should be used: it is recommended to use a value of 750μs for the inter-character time-out (t1.5) and a value of 1.750ms for inter-frame delay (t3.5).

                In the past we have had some issues with timing on some systems so we added a larger inter-character space.

                However your scope is showing spacing greater than the 750μs maximum which is causing the problem.

                To answer your question:

                is mango useing this code?
                Yes that is the code we use.
                Proposed solution:

                Add an additional constructor to the Modbus4j library that allows passing in the spacing.

                Add an additional constructor to the Modbus4j library that allows choosing to use 0 spacing or let the library compute the spacing based on the serial settings.

                Keep the existing constructor that defaults to computing the spacing.

                Expose the option to set the spacing in the Mango Modbus Data Source module.

                Each proposed solution is good enough..
                You made the RTU timing settings configurable. :)
                But i don't know how to update this files in my mango installation...

                1 Reply Last reply Reply Quote 0
                • terrypackerT
                  terrypacker
                  last edited by

                  xbastek,

                  You say:

                  But i don't know how to update this files in my mango installation...

                  It will be far easier for you to upgrade to Mango 2.6.0 that has all the work done for you. It will be pre-released very soon.

                  Thanks,
                  Terry

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