• 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

    Binary to multistate meta point

    User help
    2
    6
    3.0k
    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.
    • M
      matthew.sellars
      last edited by

      I would like to use a binary and a numeric as context points in a multistate meta point.
      My problem is with the binary context point. The statement if(n.value==1.0) works for the numeric point but if(b.value==true) does not work for the binary.
      I have tried different combinations of true, false, 1, 0, 1.0. 0.0 with no change.
      Writing “return k” and clicking the Validate Script button yields the message Success. result=true but using if(k.value==true) does not work.

      
      // multistate meta point
      // k = fanRelay (binary)
      // p = fanProof (numeric)
      var s = 0
      
      if(k.value==true) {
          if(p.value==1.0) {
              s = 1;
          }
          else {
              s = 2;
          }
      }
      
      
      1 Reply Last reply Reply Quote 0
      • M
        mlohbihler
        last edited by

        Works for me. In fact, both of these do:

        if (b.value == true)
        

        ... and:

        if (b.value)
        

        Best regards,
        Matthew

        1 Reply Last reply Reply Quote 0
        • M
          matthew.sellars
          last edited by

          I have been experimenting with Virtual data points as banging the fan on and off was slow.
          If I switch the context variables in this meta point it will work.
          Changing the state of the binary variable has no effect.

          Attachment: download link

          1 Reply Last reply Reply Quote 0
          • M
            matthew.sellars
            last edited by

            I installed ScadaBR alongside Mango M2M on my server and the bug does not exist in ScadaBR.

            ScadaBR works correctly.

            I still cannot use binary context points in Mango.

            return binaryPoint.value; fails on my fresh Mango install.
            
            1 Reply Last reply Reply Quote 0
            • M
              mlohbihler
              last edited by

              As i said, it works for me. What version are you using?

              Best regards,
              Matthew

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