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 display unit conversion math


  • I have come across an odd situation with unit conversion. We have flow meters which report in m³/h, and Mango is configured to convert to gal/min for display. The meter itself can be configured to display in gal/min, even though the data cannot be reported in any other units. This was previously addressed in another post (https://forum.mango-os.com/topic/4388/are-values-in-converted-unit-available-to-scripts), and the workaround provided by @phildunlap has been working fine, until recently when we replaced the unit with a MangoGT. Then we noticed the display (and more critically, our scripts) was off.

    The result is the local display is wrong, along with scripts which use the converted units. However, the data is published (persistent TCP) and the receiving unit (cloud instance) is displaying the gal/min correctly, in agreement with the display on the device.

    For example, as I debug one of the scripts, it reads the metric flow at 2.2167255878448486 m³/h; the device and the Mango instance receiving the published data display an accurate 9.76 gal/min. However, Mango's rendered value is a mysterious 8.1 gal/min.

    FWIW the gateway device is a MangoGT running version 3.7.7
    The cloud instance is also running Mango version 3.7.7

    Any other details that might be useful?

    Aldo


  • @AldoRamos I would first confirm that the Unit on the mysterious point is the same as the Rendered Unit. If not Mango will convert from one unit to another. Just a thought.


  • I don't quite follow your question/suggestion.

    Let me reiterate that the data point is configured as m³/h with the display unit as gal/min

    On the MangoGT, the display unit is off, both in comparison to the device as well as according to the math. However, it is published to the cloud, where the configuration is identical, the display unit is correct, matching the device and the math.


  • I think he means compare .value with .renderedValue...

    Fox


  • The obvious question is that the MangoGT has an ARM processor, while the cloud has an Intel processor. Is the Java math off on the ARM processor?

    This should be easy to duplicate, just a data point with the units as I've described, with a manually-entered point value.


  • Fair question. Sorry even I didn't consider that!


  • Here is the original datapoint on the MangoGT, reading from a meter via MODBUS (stripped down):

    {
       "dataPoints":[
          {
             "dataSourceXid":"DS_MODBUS_RS485",
                    "enabled":true,
             "xid":"DP_CW_flow_inlet",
             "textRenderer":{
                "useUnitAsSuffix":true,
                "format":"0.0",
                "type":"ANALOG"
             },
             "loggingType":"ON_CHANGE_INTERVAL",
             "overrideIntervalLoggingSamples":false,
             "defaultCacheSize":1,
             "renderedUnit":"gal\/min",
             "setPermission":"",
             "tags":{
                "varName":"flowIn",
                "systemID":"115",
                "system":"Creekwood",
                "chart":"true",
                "flow":"true"
             },
             "unit":"m³\/h",
             "pointLocator":{
                "charset":"ASCII",
                "writeType":"NOT_SETTABLE",
                "offset":0,
                "slaveId":2,
                "slaveMonitor":false,
                "multiplier":1,
                "multistateNumeric":false,
                "registerCount":0,
                "range":"HOLDING_REGISTER",
                "modbusDataType":"FOUR_BYTE_FLOAT_SWAPPED",
                "bit":0,
                "additive":0
             },
             "name":"Flow Rate (Inlet)",
          }
       ]
    }
    

    And here is the data point on the cloud instance (Intel), also stripped:

    {
       "dataPoints":[
          {
             "intervalLoggingType":"INSTANT",
             "dataSourceXid":"DS_persistent_TCP",
             "enabled":true,
             "xid":"115DP_CW_flow_inlet",
             "textRenderer":{
                "useUnitAsSuffix":true,
                "format":"0.0",
                "type":"ANALOG"
             },
             "loggingType":"ALL",
             "renderedUnit":"gal\/min",
             "tags":{
                "varName":"flowIn",
                "systemID":"115",
                "system":"Creekwood",
                "EdgeServerID":"115",
                "chart":"true",
                "flow":"true"
             },
             "unit":"m³\/h",
             "pointLocator":{
                "settable":false,
                "dataTypeId":3
             },
             "name":"Flow Rate (Inlet)",
          }
       ]
    }
    

  • Has anyone been able to duplicate this? Any other thoughts or theories? Suggestions, what should I try?