# system.util.getSystemFlags()

**URL:** <https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903>\
**Category:** Ignition\
**Created:** [July 15, 2021, 11:26pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903 "2021-07-15T23:26:29Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [July 15, 2021, 11:26pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/1 "2021-07-15T23:26:29Z")

</div>

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'

They are both running 8.1.7

---

<div class="post-metadata">

**Author:** ![jimender2](https://avatars.discourse-cdn.com/v4/letter/j/f05b48/32.png) [@jimender2](https://forum.inductiveautomation.com/u/jimender2)\
**Post date:** [July 16, 2021, 2:59am UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/2 "2021-07-16T02:59:14Z")

</div>

Have you tried restarting the designer? I have had script consoles act up in the past and restarting helped fix it.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [July 16, 2021, 3:32am UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/3 "2021-07-16T03:32:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [July 16, 2021, 3:24pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/4 "2021-07-16T15:24:01Z")

</div>

That is it. One of the gateways does not have the vision module installed.

Is it safe to use this instead? It seems to work on both of the gateways scripting console.

```auto
from com.inductiveautomation.ignition.common.model import ApplicationScope
scope = ApplicationScope.getGlobalScope()

if ApplicationScope.isGateway(scope):
	print 'gateway'
elif ApplicationScope.isClient(scope):
	print 'client'
elif ApplicationScope.isDesigner(scope):
	print 'designer'

```

---

<div class="post-metadata">

**Author:** ![jcoffman](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jcoffman/32/6429_2.png) [@jcoffman](https://forum.inductiveautomation.com/u/jcoffman)\
**Post date:** [July 16, 2021, 4:17pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/5 "2021-07-16T16:17:04Z")

</div>

This is part of our core platform and is [published API](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/ignition/common/model/ApplicationScope.html) 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.

---

<div class="post-metadata">

**Author:** ![olivier.cote](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@olivier.cote](https://forum.inductiveautomation.com/u/olivier.cote)\
**Post date:** [September 26, 2025, 12:27pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/6 "2025-09-26T12:27:35Z")

</div>

By any chance, is there a way to know what type is the client ?

`ApplicationScope.`**[`isClient`](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.1/com/inductiveautomation/ignition/common/model/ApplicationScope.html#isClient(int))**`​(int scope)`

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 ?

Thanks!

---

<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:** [September 26, 2025, 12:32pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/7 "2025-09-26T12:32:12Z")

</div>

For legacy functions, "Client" means Vision. A script running in gateway scope, whether Perspective or not, will never have Client scope.

---

<div class="post-metadata">

**Author:** ![olivier.cote](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@olivier.cote](https://forum.inductiveautomation.com/u/olivier.cote)\
**Post date:** [September 26, 2025, 1:40pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/8 "2025-09-26T13:40:55Z")

</div>

In the Gateway  
A script calle test.fun() is defined

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9f9b42b77dd0f5bf6f69d9f5a72a549359933783.png)

In the designer

Under the Vision module  
test.fun() is called.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/9/59a09c4adc2947a50d381b135b8a9a4ad176cfbf.png)

In the Log Viewer  
ApplicationScope appear to be “isClient”  
\*Note that i was not seeing it in the Gateway Logs

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/2/224424d2cd0893d42ef539aefa00437a8363bced.png)

In the Perpective Module  
In a view, a button call the same script  
test.fun()

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/a/8a48be89dd4e4543ac30cc38e43324482ed23996.png)

In the Gateway Logs  
ApplicationScope appear to be “isGateway”

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6da696b8a57fd58fc64e9c18b5758c8a53a16a1a.png)

In the Tag  
A tag is defined and have a Value Changed Script that call test.fun()

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/1/b1a76414f05aba68df3913c36374b890fc141e38.png)

In the Gateway Logs.  
ApplicationScope appear to be “isGateway”

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/f/f/ff1c64acd60d555c7988d3bb8ae1e1d9ce4167e9.png)

——————————————  
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

Thanks

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 26, 2025, 1:49pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/9 "2025-09-26T13:49:12Z")

</div>

> [@olivier.cote](#):
>
> In the Gateway  
> A script calle test.fun() is defined

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.

---

<div class="post-metadata">

**Author:** ![olivier.cote](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@olivier.cote](https://forum.inductiveautomation.com/u/olivier.cote)\
**Post date:** [September 26, 2025, 1:52pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/10 "2025-09-26T13:52:43Z")

</div>

Is it possible to distinguish from a Perspective session and a Gateway Event Script ?

From what I understand, I don’t think so unfortunatly.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [September 26, 2025, 1:53pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/11 "2025-09-26T13:53:42Z")

</div>

Not unless you send an identifier with the function call.

---

<div class="post-metadata">

**Author:** ![olivier.cote](https://avatars.discourse-cdn.com/v4/letter/o/e9bcb4/32.png) [@olivier.cote](https://forum.inductiveautomation.com/u/olivier.cote)\
**Post date:** [September 26, 2025, 1:55pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/12 "2025-09-26T13:55:13Z")

</div>

Thank you for responding! 🙂

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 26, 2025, 3:50pm UTC](https://forum.inductiveautomation.com/t/system-util-getsystemflags/48903/13 "2025-09-26T15:50:17Z")

</div>

Well, you _can_, but it's technically unsupported because it relies on an import from our core Java code.

> [@Can I tell what scope a script is running from?](https://forum.inductiveautomation.com/t/can-i-tell-what-scope-a-script-is-running-from/70880/9):
>
> This post came up in a lot in my searches and had to make adjustments to it to differentiate between whether a script was being run on the Gateway vs a Perspective Session Scope, IE whether Perspective session properties exist. Here is a quick change to the above method that solved it for me. from com.inductiveautomation.ignition.common.model import ApplicationScope class Scope(object): @staticmethod def get(): scope = ApplicationScope.getGlobalScope() if ApplicationScope.isClient(scope…
