Call shared scripts from Tag

Hi,
I have some scripts located at the Global project.
I would like to know how I can call this shared scripts in Tag Script (value changed).
Is it possible with Ignition 8.1?
Thanks.

Ignition v8+ expanded the possibilities for tag event scripts by allowing you to define a Global Scripting Project. If you upgrade a v7.9 server, or restore a v7.9 gateway backup, the upgrade process will automatically set this for you to keep your tag events working. (In the global project that all other projects inherit from.)

If you start from scratch in v8+, you must set this yourself, to any project you want to hold such scripts. If you can, you should alter an upgraded system to isolate tag event script into their own project, so that you can edit them without restarting all of the projects in the gateway (a major hassle in v7.9).

My project was converted and I already have my scripts in the Global Project.
I am able to access them in Perspective and in Vision, I'm just not being able to access them from tags. My tag script is not working because I'm calling a shared function, and it stops the script from running.

How? The automated conversion only happens when restoring a complete gateway backup, not anything to do with project import/export.

"Global Project" is not "Global Scripting Project". The latter is a gateway setting.

Please click on the link in my other comment. It leads to numerous discussions of this.

You can also find a full explanation in the upgrade guide:

https://docs.inductiveautomation.com/display/DOC81/7.9+to+8.1+Upgrade+Guide

My project was converted from 7.9 to 8.1. We made a complete restore gateway backup.
I also included my Global Project to the Gateway Scripting Project configuration. Please see picture below

I tracked the Tag script event and I got a error message. Please see below:

Did someone change the Global Scripting Project setting? Because the conversion process names that project "global", not "Global".

Yes, it written Global since our project has capital letter. But before, it was blanked.

You might want support to look over your shoulder. I'm out of ideas.

We found the reason for our issue.

The tags and the global project are located at different servers.
There’s a server for tags, and another one for projects (vision, perspective), which include the Global project.

The scripts in the Global project are pointing to the tags in the Tags server. This is working.
I thought about moving my global project to the same server where my tags are located. If I do it, my tags scripts will work.
But my question is: If I do it, will I be able to access the shared scripts from my projects (vision, perspective), since they will be in a different server?
Thanks.

You can't easily. You could do something with gateway messages.

Best option is to have a script project on the tag server that is only the tag scripts and a script project on the perspective gateway.

1 Like

You could also use the eam to synch your gateway Global projects, or parts of them. It's useful to also group your scripts and script packages into different packages for frontend and backend gateways, so you know which ones apply to specific gateways only. I use shared.fe for frontend and shared.be for backend