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 1.13.0 Modbus Data Source issue


  • Try these steps:

    1. Create Modbus Serial data source
    2. Create numeric point as Holding Register and 2 byte signed integer
    3. Make this point writable
      4. Set multiplier to 0.1 for this point

    Isuue:
    Try to write 12.7 to this point. Actually written value is 126 (instead of 127).
    I think problem is in method setPointValue() of class ModbusDataSource.

     
        ...
               if (dataPoint.getDataTypeId() == DataTypes.NUMERIC) {
                    double convertedValue = valueTime.getDoubleValue();
                    convertedValue -= pl.getVO().getAdditive();
                    convertedValue /= pl.getVO().getMultiplier();
                    modbusMaster.setValue(ml, convertedValue);
                }
        ...
    
    

    convertedValue gets 126.99999999999999. Fractional part of this value gets lost in method modbusMaster.setValue().


  • A rounding feature has been added to Modbus4J. This should be available in the next version of Mango.


  • the next private version of mango u mean :wink:


  • Not what i mean at all.


  • so why the latest version of mango is kept private ? where can i find the source code of the version 1.13.0 since it's GPL ?


  • There are some business-side changes to Mango that are being discussed. Stay tuned for details.


  • we hope that these "business-side changes " things don't affect the licence (GPL) !! and we're tuned for details as well :)
    thanks for the quick feed back mate;)


  • any ideas why does modbus datapoints gain fraction of its value when multiplier is set to 0.1?

    I've tested this by having a datapoint with multiplier of 1 and it stays the same all the time.
    When multiplier is set to 0.1 the value gets added like 0.000000002 sometimes. Funny thing is that it doesnt happen all the time.
    Meta point with just script that adds multiplier of 0.1 to datapoint with multiplier of 1 stays in one decimal at all times.

    what goes wrong?


  • I've been playing with Dallas one wire sensors etc for sometime as they are reasonably cheap. The end plan is to control the house heating system intelligently. Currently we have a standard two zone system with a boiler.