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

How to write code when get first value will be stop recevied the second value in meta ?


  • Morning.everyone.
    Now I use mango received the data from equipment .and I set a meta point.the code as below,the datapoint in meta named p1.When I get the first value>2.0,I donot received the second value>2.only get first value>2 will go to end.How to write .thanks.

    if (p1.value>2.0)
    {
    return p1.value;}
    else {
    return (NaN) ;
    }


  • No answer? :(


  • have not answer?

    why for this question for so long time and no any answer?


  • Rather than return NaN return my.value which will just returns it's current value.


  • Thanks,Joels.
    In meta if I have 15 value,(I have set cron in the meta),from the 15th value start ,when 15th.value>2,then end.no need to continute 14th value. if 15th<2, then 14th value to compare with 2.if 14th.value>2 ,then end . if 14th.value<2, then 13th will compare with 2. if every value all 15 is less than 2.then will undisplay vlaue. this is my script. Is it right? Need your modify.

    Thanks

    var n=1
    switch (n)
    {
    case 1:
    if (p15.value>2.0)
    { return p15.value;}

    break;
    case 2:
    if (p15.lastValue(1)>2.0)
    return p1.lastValue(1);
    break;
    case 3:
    if (p15.lastValue(2)>2.0)
    return p1.lastValue(2);
    break;
    case 4:
    if (p15.lastValue(3)>2.0)
    return p1.lastValue(3);
    break;
    ........
    case15
    if if (p15.lastValue(15)>2.0)
    return p1.lastValue(3);
    break;
    return (NaN);

    }