Shared script on tag change

In previous Igntion versions i could use the shared scripts on tag change scripts.
How do I do this in Ignition 8, since the shared script isn’t there anymore?
Or eg. use the runscript on an expression tag?
I tried using the parent project to place the shared script, but i’m not able to run it from a tag.
How is this done in Ignition 8?

Is the parent project set in the Gateway Settings, under Gateway Scripting?

https://docs.inductiveautomation.com/display/DOC80/Gateway+Settings#GatewaySettings-GatewayScripting

No it wasn’t, thanks

On upgrades from 7.x it will be set to “global”, on new installs it’s not set to anything because there’s no projects to set it to yet.

1 Like

I also have the same doubt! When I create a new project and define the gateway scripts there, I am able to select tags for tag change event scripts. However I was told that we should use a parent project to define these scripts to have them shared by the inherited projects. However I am not able to select any tags while I define tag change scripts in the global project!

Its possible to create a new project and define tag change scripts in gateway events scripts there. However if I save this project and we import in to other projects, the scripts get executed in both projects for a tag change event! I was told that we should not import one project into other but use inheritance. Even if inheritance works, how can users inherit my scripts in their already created projects? I am confused how to resolve this dilemma!

Found a solution, experts please let me know if I am on right track.

1 I define my gateway event scripts and project scripts in a parent project but without assigning any tags to tag event scripts. I create a new project inheriting from this. In case of an existing project I assign the parent to this from the status>projects main menu of ignition. Then I edit the project and override the inherited gateway scripts and assign tags that I want to trigger them from.
2. To avoid the gateway events triggering in multiple projects (in case multiple projects inherit from this parent) I have to use different tag for each project as dB is common.

Hope this is right approach?! However I still have following doubts (sorry I am a slow learner?!)

  1. What if a project already inherits from another parent project? How can I inherit my scripts from another parent? IE is multiple inheritance supported?
  2. Can multiple projects be involved simultaneously in runtime from the ignition server ? Or it’s one at a time?
  3. Will global variables defined in parent and inherited and overridden in another project occupy the same location in memory? What about in multiple projects inheriting and overriding the global variables of the parent project , will they share same location in memory?

Sorry for the unending list of my doubts. Will appreciate a clarification from any scripting experts !

Regards

1 Like

Hi thanks for not replying to my above doubts so far, I could do some self study, homework and trials and came with the following conclusion on my doubts above.

I guess, I can create a parent project and define my gateway scripts there and make it a parent of the existing parent of the existing project. This way I can achieve multiple inheritance?

This is clear now after reading the documentation on projects that YES they can be.

I guess if the scripts are overridden in child project then the global variables defined there will have a different location, where as if they are not overridden in the child projects, then they will share the same physical memory location across projects.

Please let me know if my under standing is correct?

I have few further clarifications:

  1. The project inheritance feature exists even in version 7.9.10 , I didn't know this! Since which version is this supported?

2.What was the idea behind keeping gateway scripts as part of project resources in previous versions if they are same across multiple projects ? . This causes multiple execution of these scripts for copied projects. These could have been in shared scripts?
3. Where are shared scripts backed up in previous versions? In gateway backup?

Will appreciate your reply asap.

regards