• Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular

    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

    ReferenceError on Meta Data Source script

    User help
    3
    7
    642
    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.
    • W
      Wingnut2.0 last edited by

      Hello,

      This is related to Core 3.6.4 / Meta 3.6.2.

      When attempting a simple script

      var myTotal = (p1148.value + p1164.value + p1068.value + p22238.value);
      return(myTotal);
      

      I receive the following error that I was hoping someone could shed some light on -

      ReferenceError: "$EXEC" is not defined at line: 23 at line: 23
      

      Thank you

      1 Reply Last reply Reply Quote 0
      • CraigWeb
        CraigWeb last edited by

        @Wingnut2-0 No need for the parenthesis around (myTotal) should just be return myTotal

        1 Reply Last reply Reply Quote 0
        • W
          Wingnut2.0 last edited by

          Thanks @CraigWeb
          I corrected that and continue to have the same error.

          1 Reply Last reply Reply Quote 0
          • CraigWeb
            CraigWeb last edited by

            @wingnut2-0 said in ReferenceError on Meta Data Source script:

            var myTotal = (p1148.value + p1164.value + p1068.value + p22238.value);
            return(myTotal);

            I am not able to reproduce this error on the same version of mango. Could you provide more information?
            Is this on the v3 UI or legacy UI?
            Do you get that error when trying to validate the script?
            Can you export you points JSON and paste is here?

            1 Reply Last reply Reply Quote 0
            • W
              Wingnut2.0 last edited by Wingnut2.0

              I receive the error when validating the script in both the v3 and legacy UI.

              I checked and on this particular instance of mango I had made the changes referenced here
              https://forum.infiniteautomation.com/topic/4503/simple-ping-monitor
              and here
              https://forum.infiniteautomation.com/topic/3818/invoke-shell-commands-from-a-scripting-environment

              1 Reply Last reply Reply Quote 0
              • terrypacker
                terrypacker last edited by

                @Wingnut2-0 any chance you have global scripts with a call to $EXEC

                Seems like line 23 would indicate that script of 2 lines has a lot more to it than what you shared. Which usually means there are global scripts being put into the context.

                One thing to check is the script permissions. I know that in later versions of mango we restricted the environment when it does not have superadmin permission. I am not sure how the $EXEC call will perform in that situation.

                1 Reply Last reply Reply Quote 0
                • W
                  Wingnut2.0 last edited by

                  Thank you @terrypacker. I had a global script using $EXEC
                  Once I removed that the script would execute.

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