• 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

    DNP3 analog input

    User help
    3
    5
    1.8k
    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.
    • D
      decarli.f
      last edited by

      Hi guys,

      I am working on a project including a voltage regulator that communicates with mango by DNP3 protocol and send the values to an arduino by modbus protocol.
      For that I configured some point links aiming to transfer the analog values from the voltage regulator to arduino, using mango as a gateway.
      On point link configuration I used the following script:
      return source.value;
      Problem: It is possible to read the voltage regulator analog values on data point but it does not send the correct values to arduino.

      Additional information:
      I tried to write and read integer values on arduino Modbus registers using mango modbus configuration interface, and it is works fine.
      The arduino modbus library is Modbusino.h which allocates the registers on type uint16_t.

      Can someone help me?

      Best Regards,

      Felipe

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by

        Just my random thought...
        Are you using modbus because you're going to be using multiple devices in a system and thus modbus works best?
        Alternaively if you're just implementing sending information to the Arduino and nothing else, why not use the built in Serial (UART) and send data that way rather than relying on a third party library on top and then in turn another layer of complexity for you to have to fix/debug when something goes wrong.

        Just my ten cents.

        Fox

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • phildunlapP
          phildunlap
          last edited by

          Hi decarli.f,

          I agree with Fox that using a simple protocol on the UART may be easier.

          From your description, you make it sound like a value is set but that it is the incorrect value when you check it in the Arduino. I can only thing of a few things that could cause that,

          1. Wrong data type for setting the value. Perhaps you should try the two byte unsigned swapped instead of two byte unsigned?
          2. Wrong offset. Some libraries / devices base their register range offsets of 1 instead of 0. Mango uses a zero index.
          3. Some communication error. Usually would have a protocol level failure and not a wrong value, but it is possible. If you're reading the right values from the modbus device then this is almost certainly not the cause.
          1 Reply Last reply Reply Quote 0
          • D
            decarli.f
            last edited by

            Hi Phil and Fox

            I tried to use two byte unsigned swapped and it did not worked.
            I checked and tested the offset value. It is correct.
            I think the protocol works because i successfully tested the communication using the modbus configuration interface (using two byte integer).

            Considering all tests and results, I think the problem is that the float values (regulator outputs) are not compatible with the 2 byte integer data, which is the type that Arduino can read and process.
            At this point, i am trying to convert the float values to short or two byte integer in the point link script. The lack of number precision is not an issue for this project.

            If you know any script which convert this data.

            Best Regards,

            Felipe

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by phildunlap

              Hi Felipe,

              I'm not sure what you mean. The Modbus4J library will already handle the conversion from a numeric point value (a double) in Mango to whatever data type it needs to be. You can see the exact code for this here: https://github.com/infiniteautomation/modbus4j/blob/50d7dfe6c0330bf720ae97492c9213c21fdb8d5f/Modbus4J/src_cdc/com/serotonin/cdc/modbus4j/locator/NumericLocator.java#L201

              I can assure you many people have set values to integer registers through the Mango interface. I am not sure what this means,

              Considering all tests and results, I think the problem is that the float values (regulator outputs) are not compatible with the 2 byte integer data, which is the type that Arduino can read and process.

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