• 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

    Problem with Meta point

    User help
    3
    11
    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.
    • H
      hayden_AUS
      last edited by

      Hi,

      Have an issue with a basic meta point that returns an error:
      0_1567466414177_error.JPG

      Here is the point, just a basic meta script:
      0_1567466457101_point.JPG

      The script is:

      if (p48.value === true || p50.value === true || p51.value === true || p52.value === true || p53.value === true || p54.value === true || p67.value === true || p45.value === true){
          return true;
      }
      else{
          return false;
      }
      

      Weird thing is that a similar script works on another instance.

      H

      1 Reply Last reply Reply Quote 0
      • MattFoxM
        MattFox
        last edited by MattFox

        Try replacing true and false with 0 and 1 instead, it is a binary point afterall. Also.. What logging type is the point set to?

        Do not follow where the path may lead; go instead where there is no path.
        And leave a trail - Muriel Strode

        1 Reply Last reply Reply Quote 0
        • H
          hayden_AUS
          last edited by

          I had to change Mango machines on this site, so ended up doing an "export" then "import".

          I think for some reason the Meta point did not like one of the points having a binary point rendered as "ON and OFF", which was imported from the old machine.

          Once I changed this back to true/false, it worked OK. I then changed it back to ON/OFF and still works.

          Seriously spent a couple of hours on this.

          I did also try the 0/1 as well in the script, didn't work.

          The script always validated.

          Did my head in, but working now.

          1 Reply Last reply Reply Quote 0
          • MattFoxM
            MattFox
            last edited by

            Most bizarre indeed. Sometimes I find myself better off copying and pasting scripts...
            Glad to hear you managed to wrangle it though man.

            Fox

            Do not follow where the path may lead; go instead where there is no path.
            And leave a trail - Muriel Strode

            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by phildunlap

              Hi hayden_AUS, Fox,

              None of the theories presented sounds correct to me.

              Try replacing true and false with 0 and 1 instead, it is a binary point afterall. Also.. What logging type is the point set to?

              true and false are fully legitimate values to return from a meta point for a binary point. The logging type isn't taken into consideration in that script output message.

              I think for some reason the Meta point did not like one of the points having a binary point rendered as "ON and OFF", which was imported from the old machine.
              Once I changed this back to true/false, it worked OK. I then changed it back to ON/OFF and still works.

              Rendered values are not available directly in scripting environments. I opened a git issue about that a while ago, and have posted examples on the forum of how to use DataPointVO objects to render the values.

              Judging by the script output message, it looks like there was a global script or some such running return "Success, no new value"; being executed prior to the meta point, which maybe was changed between restarting the point. That output message is the new value message (from Meta/classes/i18n.properties: dsEdit.meta.test.successTs=Success. result={0}, timestamp={1}), but the value is that string (and so it says success twice), so it seems to have come from somewhere other than this script.

              Edit: As to the event message, the only way I would expect to reproduce that would be returning an alphanumeric point value time with the value of "false", as if through something like return alphanumericPoint.lastValue();

              1 Reply Last reply Reply Quote 0
              • H
                hayden_AUS
                last edited by

                Hi guys,

                I am still having issues with this.

                Issue1: Returns "error could not convert to Binary".
                Issue2: Meta point will not go false after Advanced scheduler activation.

                I have checked all data points in the script, and made sure they are all binary.

                When I have the Meta point set to "Change":
                Manually setting a solenoid to TRUE, sets the Meta point to TRUE
                Manually setting the solenoid to FALSE, sets the Meta point to FALSE
                Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid sets the Meta TRUE
                Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid does NOT set the Meta FALSE

                When I have the Meta Point set to "Update":
                Manually setting a solenoid to TRUE, sets the Meta point to TRUE
                Manually setting the solenoid to FALSE, sets the Meta point to FALSE
                Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid sets the Meta TRUE
                Setting the Solenoid to TRUE via an Advanced scheduler>virtual point>point link>solenoid DOES set the Meta FALSE
                However returns an error when going TRUE:
                'Meta': Script result type error in point "Meta - Pump control": Could not convert result "PointValueTime(true@2019/09/05 11:00:37.543)" to Binary

                I have also changed my script with relation to the else statement so that if ALL are false:

                if (p84.value === true || p45.value === true || p48.value === true || p50.value === true || p51.value === true || p52.value === true || p53.value === true || p54.value === true){
                    return true;
                	}
                else if (p84.value === false && p45.value === false && p48.value === false && p50.value === false && p51.value === false && p52.value === false && p53.value === false && p54.value === false){
                	return false;
                	}
                

                Also just got another error appear:
                'Meta': Script result type error in point "Meta - Pump control": Could not convert result "PointValueTime(false@2019/09/05 11:26:13.583)" to Binary

                There were no context point changes.

                Only happens when I have the Meta point set to Update.

                1 Reply Last reply Reply Quote 0
                • MattFoxM
                  MattFox
                  last edited by

                  Why not use the script setting for the event when it fires from your advanced scheduler?
                  You could tie all of your context points in there and link it all that way.
                  Just a suggestion here.

                  Do not follow where the path may lead; go instead where there is no path.
                  And leave a trail - Muriel Strode

                  1 Reply Last reply Reply Quote 0
                  • H
                    hayden_AUS
                    last edited by

                    Hi Fox/Phil.

                    I tried a scripted data point first, but ran into the same issues.

                    I have no other global scripts running now, no scripted data sources. There are no alphanumeric data points in the instance.

                    I'll try creating the same issue on another instance.

                    In relation to scripting, in event handler, where you set external context points, is the key variable name what would be used if creating a scripted data point?

                    1 Reply Last reply Reply Quote 0
                    • H
                      hayden_AUS
                      last edited by

                      Just tested on my ES using virtual points and works fine;
                      The Meta point switches off after the advanced scheduler goes inactive.
                      The Meta point is set to "change"

                      There must be issues with the free instance I am using...

                      Any ideas how to fix, or do I have to re-build the instance?

                      1 Reply Last reply Reply Quote 0
                      • H
                        hayden_AUS
                        last edited by

                        I separated the Pump control meta point (shown way at the top of thread) into two meta points,
                        one for solenoids and one for other switching.

                        Set both to "Update"

                        Both working fine without errors.

                        ????? Sheech, what an ordeal.

                        1 Reply Last reply Reply Quote 0
                        • phildunlapP
                          phildunlap
                          last edited by

                          Okay, I took a deeper look, and it appears the validation of binary meta points and other scripts with expected result types has an issue with returning false, as the message reports as though it return UNCHANGED; . This does not affect the actual runtime of the points or other such scripts. So, that explains the output on the validation in the first post. https://github.com/infiniteautomation/ma-core-public/issues/1487

                          Thanks for bringing this to our attention!

                          I have not been able to reproduce the event message except by returning a value with something like the lastValue function, although it could be a binary point doing that as well. In your first script there is an else if so it would be possible not to return a value, although I would expect it to get a false (binary) / 0 (numeric and meta) / empty string (alphanumeric) value if nothing is returned.

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