How come on one of my gateways when I run system.util.getSystemFlags() in the script console I get 1, but in another gateway in the script console I get an error?
AttributeError: 'com.inductiveautomation.ignition.designer.gui.tool' object has no attribute 'getSystemFlags'
You probably don’t have the Vision module installed on the gateway/designer where it doesn’t work. This is one of a handful of really old functions that are actually added by the Vision module and don’t exist without it.
This is part of our core platform and is published API so you can definitely use the ApplicationScope class. That being said, some future qualifying releases (this would usually be a major release) of Ignition may change this class implementation but I wouldn’t expect that anytime soon.
Let’s say a gateway with Vision AND Perspective.
They would booth have the same GatewayScript.
Does the applicationScope can inform on the type of client ?
——————————————
Now that I have expose this demonstration
Is there a way to have a script that would help me to branch on
-Executed from Vision
-Executed from Perspective
-Executed from Tag
This is a common misunderstanding. Functions defined in a Project Library, have no scope. They are run in the scope from which they are called.
A function defined in a project library, which is called from a vision component, will run in Vision Client Scope. That same function called from a perspective script transform will run in Gateway (Prespective) Scope. That same function called from a Gateway Event Script will run in Gateway Scope.
If that function is defined in the Gateway Scripting Project and is called from a Tag it will run in Gateway Scope.
As you can see, there are really only two scopes, Gateway and Vision Client.
Prespective is a varient of Gateway Scope, and Designer Scope is a varient of Vision Client Scope.