Call shared function from multiple OPC Tags

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

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

1 Like

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