• 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

    Are values in converted unit available to scripts?

    Scripting general Discussion
    2
    6
    1.7k
    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.
    • AldoRamosA
      AldoRamos
      last edited by

      I've been debugging a script that checks when Flow Rate exceeds 3gpm, After much confusion, I remembered that the device reports m³/h, and that data point is configured with "Convert Unit for display" checked, to convert it to "gal/min".

      Converted and Rendered values are available in the dashboard data point objects, but apparently not in scripting. Is there an intrinsic method for accessing the converted value, or do I need to do explicit math in the script?

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

        Hi AldoRamos,

        I opened a git issue for this last time it came up on the forum, but I don't believe my suggestions were commented on or implemented: https://github.com/infiniteautomation/ma-core-public/issues/1402

        I gave the way to solve this in the interim in the thread I linked to: https://forum.infiniteautomation.com/topic/3989/send-multiple-point-value-in-alarm-text/6

        1 Reply Last reply Reply Quote 0
        • AldoRamosA
          AldoRamos
          last edited by

          Thanks @phildunlap, that should make it much more practical and maintainable.

          1 Reply Last reply Reply Quote 0
          • AldoRamosA
            AldoRamos
            last edited by AldoRamos

            This script is based on the XID; is there a way to get the "VO" from a conext point, or do I need to start with the XID?

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

              You can get the VO via the DataPointRT in the CONTEXT_POINTS array (which is that DataPointRT objects of the enabled points in the context) via:

              CONTEXT_POINTS["variableName"].getVO();
              
              AldoRamosA 1 Reply Last reply Reply Quote 0
              • AldoRamosA
                AldoRamos @phildunlap
                last edited by

                @phildunlap Excellent! That's really useful information.

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