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

Serial data source set data point to numeric


  • Hi All,
    I am using the serial data source to process a string of values from a sensor node. e.g. CL 221.035BV=([0-9]+.[0-9]+)\r
    CL is the node type, 221.035 is its address, BV is the point type and the value is a numeral with decimal point preceded by a "=" and terminated with \r.
    I am using the following regex for the data point CL 221.035BV=([0-9]+.[0-9]+)\r

    The problem is I am unable to set the point type to anything but alphanumeric.
    Do I need to modify my regex or is this a current limitation in the serial data source?

    Cheers,
    Matt.


  • When set to alphanumeric, what sorts of values is the point getting? When set to other types what happens? It appears right in the code: https://github.com/infiniteautomation/ma-modules-public/blob/master/Serial Data Source/src/com/infiniteautomation/serial/rt/SerialDataSourceRT.java

    //Switch on the type
    switch(plVo.getDataTypeId()){
    case DataTypes.ALPHANUMERIC:
    newValue = new PointValueTime(value,new Date().getTime());
    break;
    case DataTypes.NUMERIC:
    newValue = new PointValueTime(Double.parseDouble(value),new Date().getTime());
    break;
    case DataTypes.MULTISTATE:
    newValue = new PointValueTime(Integer.parseInt(value),new Date().getTime());
    break;
    case DataTypes.BINARY:
    newValue = new PointValueTime(Boolean.parseBoolean(value),new Date().getTime());
    break;
    default:
    throw new ShouldNeverHappenException("Uknown Data type for point");
    }
    

  • Hi Philip.
    I am getting decimal formatted alphanumeric strings (see attached).
    The problem is I set the data point type to numeric and as soon as I click save it switches to alphanumeric. This is before any data is processed.

    Matt.

    Attachment: download link


  • Hey Matt, sorry it took me so long to reply, I did a little camping this weekend...

    Ah, I understand. It looks like this was the case in the point settings and for whatever reason I was reading that as a data source problem. I found the issue in the code and have corrected it I believe, and thanks for bringing this to our attention:

    Attachment: download link


  • Thanks Phillip,
    I hope camping was good. It's snow down to sea level here.
    Brrrrr...