• 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

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

    User help
    2
    6
    1.5k
    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.
    • E
      edmond
      last edited by

      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) ;
      }

      1 Reply Last reply Reply Quote 0
      • E
        edmond
        last edited by

        No answer? :(

        1 Reply Last reply Reply Quote 0
        • E
          edmond
          last edited by

          have not answer?

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

          1 Reply Last reply Reply Quote 0
          • JoelHaggarJ
            JoelHaggar
            last edited by

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

            1 Reply Last reply Reply Quote 0
            • E
              edmond
              last edited by

              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);

              }

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