runScript in expression tag errors

Quality Diagnostics Error executing script for runScript() expression:Test.myFunc() WARN

I found a few posts about this issue but I did not upgrade to 8.1 and the Gateway Scripting Project setting is now set to "global".

I also setup the simple test script that runs in the Script Console but will not run in the expression tag.



Ok, it looks like Gateway Scripting Project needs to be set to the current application name for the expression tag to be able to run the Project Library script.

I'd read a number of posts about setting it to global but I guess that is only if you are running an older Ignition version and or upgraded to 8, then there will be a Global object in the gateway?

So a new Ignition 8 application by default can't run Project Library scripts from expression tags unless you go into the System settings, Gateway Settings and then add the project name to the Gateway Scripting Project setting.

The scripting project can be set to whatever you want. The only thing required is that the scripts you want to run through tag events and such need to be on this scripting project.

So, in your case, your script is in your current project, you set the scripting project to it, everything works.

But keep in mind that if you create more projects on the same gateway, you might run into issues.
It's a good idea to have a project dedicated to scripts that need to be run from the gateway, and use it as the scripting project.
You can even inherit from it to bring those scripts into projects scope.

1 Like

Not "add". "Set." There can be only one.

If you want to share some scripts between many other projects, consider an inheritance scheme where those common scripts are at the inheritance root project, from which your UIs and your global scripting projects separately inherit them.

That was the understanding. It would be very useful otherwise. :slight_smile: