Alternative for Tags

Hi,

I have a requirement where i need to define a custom property/parameter in Ignition internally (Not to be sourced by any external means like DB…). This property/parameter will be used in projects(perspective/vision/Project Library) and in gateway scripts. I require this because i am trying to define the Tag Provide name (& Other Properties) in the custom property/parameter and as mentioned it need to accessed at any scopes. Yes I can use some tags in “default” provider to define this other tag provider name as value, but the problem here is but we don’t use default generally. So i am not sure what should be the other alternative for defining the custom property/parameter which can be accessed at any scopes.

Thanks in Advance.

Define a top-level script variable in a project script in an inherited project. Say you have the following in a script named MyConstants:

MyProvider1 = "SomeProvider"

You can then reference this string in any script as MyContants.MyProvider1, or in expression bindings like so:

runScript("MyConstants.MyProvider1", 0)
2 Likes

Thanks @pturmel , Got it worked. It was new learning for me… :pray:

Just be aware of the different scopes and that their values won’t be shared across them. E.g. Each client will have different values, checking these values in a tag expression will have different values to the client values, etc

Not a problem for configuration constants.

2 Likes