ReferenceError on Meta Data Source script
-
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
-
@Wingnut2-0 No need for the parenthesis around
(myTotal)
should just bereturn myTotal
-
Thanks @CraigWeb
I corrected that and continue to have the same error. -
@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? -
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 -
@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. -
Thank you @terrypacker. I had a global script using
$EXEC
Once I removed that the script would execute.