# Gateway scope and client scope

**URL:** <https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944>\
**Category:** Ignition\
**Created:** [April 23, 2021, 7:24am UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944 "2021-04-23T07:24:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 23, 2021, 7:24am UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/1 "2021-04-23T07:24:47Z")

</div>

Hello,  
I would like to control the buton’s visibility from a opc tag change  
In the gateway tag change script i use the folowing code:  
topDebutProd = system.tag.read(“QMP\_rebox\_2208/comPLC/topDebutProd”).value  
BTvalide=system.gui.getWindow(“Accueil”).getRootContainer().getComponent(‘BT\_lancementProd’)  
if topDebutProd:  
BTvalide.Visible=0  
else:  
BTvalide.Visible=1  
But it seems the gateway can not reach the system.gui witch depend to the vision client…  
Is there a way to do that?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [April 23, 2021, 11:16am UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/2 "2021-04-23T11:16:17Z")

</div>

Do not do this in a tag change event. In your project, make a custom property on your button and bind the tag to this property. Then in the buttons property change event do

```auto
If event.propertyName == 'yourCustomPropName':
    Do something

```

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 23, 2021, 11:49am UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/3 "2021-04-23T11:49:02Z")

</div>

Thank you for your quick answer. The button has a property visible but when i bind it to my tag, the buton is visible when my tag is true , i would like the opposite and didn’t find option to do that.  
I have already a tag change event on this tag that is why i thought to control the vivibility by script  
Anyway if it is not possible i will try your method. By

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 23, 2021, 12:11pm UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/4 "2021-04-23T12:11:33Z")

</div>

Just bind your visible property to the expression:

```auto
!{QMP_rebox_2208/comPLC/topDebutProd}

```

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 23, 2021, 12:48pm UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/5 "2021-04-23T12:48:38Z")

</div>

I have tried:  
!{QMP\_rebox\_2208/comPLC/topDebutProd}  
or  
!{“QMP\_rebox\_2208/comPLC/topDebutProd”}  
or  
\<\>!{QMP\_rebox\_2208/comPLC/topDebutProd}  
or  
![default]QMP\_rebox\_2208/comPLC/topDebutProd.value  
And many more but it always tell me: You must specify a tag or tag property…

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 23, 2021, 8:26pm UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/6 "2021-04-23T20:26:43Z")

</div>

Are you writing that into an expression binding or a tag/indirect tag binding? A tag binding only accepts a tag path, no transformations. The expression I said can only be used in an expression. If in Perspective, you could use a tag binding to read the tag value and then apply an expression transform to negate it, or you could just use an expression binding in either vision or perspective

---

<div class="post-metadata">

**Author:** ![pick](https://avatars.discourse-cdn.com/v4/letter/p/9de0a6/32.png) [@pick](https://forum.inductiveautomation.com/u/pick)\
**Post date:** [April 26, 2021, 5:42am UTC](https://forum.inductiveautomation.com/t/gateway-scope-and-client-scope/45944/7 "2021-04-26T05:42:02Z")

</div>

OK finaly I have understood… thank you very much for the tip it works
