# Gateway Tag Change Script using system.tag.writeBlocking

**URL:** <https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767>\
**Category:** Ignition\
**Created:** [October 20, 2023, 3:28pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767 "2023-10-20T15:28:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicholas\_Welch](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@Nicholas\_Welch](https://forum.inductiveautomation.com/u/Nicholas_Welch)\
**Post date:** [October 20, 2023, 3:28pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767/1 "2023-10-20T15:28:03Z")

</div>

I am trying to update a tag with the system.tag.writeBlocking function based off a boolean true or false value when the boolean tag is true I want to update each tag to the value

This is where I am currently at

#create list of modbus tags to write on peak sp to evapcold units  
paths = ["[Tippman\_Tags]PH1/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH2/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH3/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH4/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH5/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH6/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH7/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH8/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH9/EU1b/Evaporator Temp Setpoint", "[Tippman\_Tags]PH10/EU1b/Evaporator Temp Setpoint"]

#create list of onpeak setpoints to write to evapcold units  
values = ["[Tippman\_Tags]PH1/WinterMidPeakSP", "[Tippman\_Tags]PH2/WinterMidPeakSP", "[Tippman\_Tags]PH3/WinterMidPeakSP", "[Tippman\_Tags]PH4/WinterMidPeakSP", "[Tippman\_Tags]PH5/WinterMidPeakSP", "[Tippman\_Tags]PH6/WinterMidPeakSP", "[Tippman\_Tags]PH7/WinterMidPeakSP", "[Tippman\_Tags]PH8/WinterMidPeakSP", "[Tippman\_Tags]PH9/WinterMidPeakSP", "[Tippman\_Tags]PH10/WinterMidPeakSP"]

[client]Winter/MidPeak == true  
system.tag.writeBlocking(paths, values)

I keep getting a syntax error: ("no viable alternative at input 'Winter'",('',9,8,'[client]Winter/MidPeak == true\n'))

---

<div class="post-metadata">

**Author:** ![aaronrai24](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/aaronrai24/32/87248_2.png) [@aaronrai24](https://forum.inductiveautomation.com/u/aaronrai24)\
**Post date:** [October 20, 2023, 4:13pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767/2 "2023-10-20T16:13:10Z")

</div>

> [@Nicholas\_Welch](#):
>
> [client]Winter/MidPeak

This is a vision client tag, since you are writing a gateway tag change script you [dont have access](https://docs.inductiveautomation.com/display/DOC81/Vision+Client+Tags?gclid=CjwKCAjwysipBhBXEiwApJOcu5FQTC1vaWxCfCiWpB7wVGQX-xnxOToqF5AbjJT9pNNLHGt-rktKPRoCrEUQAvD_BwE) to these tags. As per the manual, 'Client Tags are only available to Vision resources, and are unavailable to Perspective and Gateway scoped resources'

I am also confused by your current script, I see you have a list of tag paths defined as `paths`, then you also have a list of tag paths defined as `values`, are you trying to write the values of the tags you defined in your `values` variable to the tags in your `paths` variable? You are definitely going to need to use [system.tag.readBlocking](https://docs.inductiveautomation.com/display/DOC81/Reading+and+Writing+to+Tags#ReadingandWritingtoTags-ReadingfromaSingleTag) in places where you need actual values,

---

<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:** [October 20, 2023, 4:23pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767/3 "2023-10-20T16:23:26Z")

</div>

> [@Nicholas\_Welch](#):
>
> getting a syntax error

Please edit you post to add proper marking for the code block. Should look like this in the comment editor:  
```  
Some pasted  
jython code.  
```

That will make it readable for us to help spot your syntax error. That has to be fixed before anything else about your script can be evaluated.

---

<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:** [October 20, 2023, 5:13pm UTC](https://forum.inductiveautomation.com/t/gateway-tag-change-script-using-system-tag-writeblocking/80767/4 "2023-10-20T17:13:04Z")

</div>

> [@Nicholas\_Welch](#):
>
> ```auto
> [client]Winter/MidPeak == true
> 
> ```

Everything about this is invalid Python. == is used to compare two values, it's `True` not `true` for a boolean value, and that client tag Python is trying to find a variable called Winter and MidPeak and divide them. [client] is trying to get an array index stored in variable `client` from no given array. If you want to read a tag you need to use system.tag.readBlocking and pass in the tag as a string (or a list of strings) . Note this returns a list of QualifiedValue objects which have a `value` property to get their value.  
But as @aaronrai24 said, client tags are Vision-scoped, inaccessible from the gateway
