• 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

    Not hex value

    Mango feedback
    3
    5
    1.3k
    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.
    • J
      jcaballeroa
      last edited by jcaballeroa

      Hi Everyone,

      I have created a data source of type HTTP Retriever to make a web request for the status of an equipment. The response of the request is simple of the type:
      result = <value>

      I would like Mango to show me the value obtained in hexadecimal. For this I have configured a Data Point as follows:
      0_1582790985123_d793e58f-1b18-4dd6-9a22-ae5913042836-image.png

      According to the Mango documentation, the following can be read:

      *"In addition to the standard DecimalFormat options you can prefix your format with '0x' to imply you want hexidecimal values rendered. This format will truncate the decimal place and requires that you supply the minimum number of places you want rendered. So 0x00 will always render at least 2 values:

      512 = 0x200
      255 = 0xFF
      16.7 = 0x10
      15 = 0x0F"*

      Therefore, if I receive a 15, I expected the value of the data point to take a 0x0F

      However, as seen in the image, the result is a negative value.
      0_1582791002768_388c9556-71d1-4ab6-a0da-5dea40dd5a36-image.png

      Am I setting something wrong or it is a bug?

      Thanks!

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

        Are you dead certain you're receiving a 15?
        Secondly perhaps check the renderedValue as well, see how that looks. Just a couple of ideas...

        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
        • terrypackerT
          terrypacker
          last edited by terrypacker

          @jcaballeroa I did some testing and found that the HTTP retriever data point's Number format input does not work like you are expecting. It uses DecimalFormat to convert the String value received into a number to store in Mango. It is not used for display purposes, which is what it looks like you are trying to use it for.

          To display a number in Hex for a Numeric point you will want to use a TextRenderer. That will accept the 0x00 format you are trying to use and display the value in Hex.

          As for why it is returning -15 instead of 15 I can't really explain that but it has to do with how java is trying to convert the String of "15" to a floating point number using the pattern 0x00 which is not a valid pattern outside of Mango's text renderer pattern formats.

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

            Thanks for verifying Terry!

            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
            • J
              jcaballeroa @terrypacker
              last edited by

              @terrypacker Thanks Terry!!!

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