# Call shared function from multiple OPC Tags

**URL:** <https://forum.inductiveautomation.com/t/call-shared-function-from-multiple-opc-tags/66791>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [November 22, 2022, 6:07am UTC](https://forum.inductiveautomation.com/t/call-shared-function-from-multiple-opc-tags/66791 "2022-11-22T06:07:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonya1](https://avatars.discourse-cdn.com/v4/letter/t/6a8cbe/32.png) [@tonya1](https://forum.inductiveautomation.com/u/tonya1)\
**Post date:** [November 22, 2022, 6:07am UTC](https://forum.inductiveautomation.com/t/call-shared-function-from-multiple-opc-tags/66791/1 "2022-11-22T06:07:00Z")

</div>

Hello there,

I want to define and call a certain function in Ignition 7.9 from OPC tag's valueChanged event, because I have multiple tags which shares the same code but the only things that differ are variables defined inside.

I know that I can use Global shared scripts but I feel to not sticking with those because they were removed in the latest version of Ignition (at least for what I've learned from the docs).

I also heard that project event scripts can be used, but that doesn't make any sense to me, because I have a feeling that this could be inconvenient plus calling project script from the gateway should be slow (correct me if I'm wrong).

Is there a way to call a function from multiple tags' valueChanged event or creating a special tag that can share the codebase for multiple OPC tags and if so, how to use it?

Thanks for help

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 22, 2022, 10:47am UTC](https://forum.inductiveautomation.com/t/call-shared-function-from-multiple-opc-tags/66791/2 "2022-11-22T10:47:31Z")

</div>

> [@tonya1](#):
>
> I know that I can use Global shared scripts but I feel to not sticking with those because they were removed in the latest version of Ignition (at least for what I've learned from the docs).

There is now project inheritance, rather than a 'shared' script space. My 7.9 shared scripts imported into a project called 'global'. The rest of my projects inhert it.

For multiple tag events, though, consider using a Gatewy event script.  
[https://docs.inductiveautomation.com/display/DOC79/Client+and+Gateway+Event+Scripts](https://docs.inductiveautomation.com/display/DOC79/Client+and+Gateway+Event+Scripts)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 22, 2022, 1:30pm UTC](https://forum.inductiveautomation.com/t/call-shared-function-from-multiple-opc-tags/66791/3 "2022-11-22T13:30:06Z")

</div>

> [@tonya1](#):
>
> plus calling project script from the gateway should be slow (correct me if I'm wrong).

You are wrong. Project scripts exist in the gateway (isolated by project) too.
